Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add ssl-ctx-set-min-ssl-version, ssl-ctx-set-max-ssl-version, etc#108

Open
jfmcbrayer wants to merge 1 commit intocl-plus-ssl:masterfrom
jfmcbrayer:fix-min-ssl-version
Open

Add ssl-ctx-set-min-ssl-version, ssl-ctx-set-max-ssl-version, etc#108
jfmcbrayer wants to merge 1 commit intocl-plus-ssl:masterfrom
jfmcbrayer:fix-min-ssl-version

Conversation

@jfmcbrayer
Copy link

These functions were added in OpenSSL 1.1.0, and setting the min/max versions
through options is now deprecated. This patch adds the functions for setting
the minimum and maximum protocol versions, the constants that represent those
versions, and additional keyword arguments to make-context.

These functions were added in OpenSSL 1.1.0, and setting the min/max versions
through options is now deprecated. This patch adds the functions for setting
the minimum and maximum protocol versions, the constants that represent those
versions, and additional keyword arguments to make-context.
@jfmcbrayer
Copy link
Author

As a note: in the master branch, make-context with the method set to tls-method, and disabled-protocols set to the list of protocols you want "works", in that it produces a working context, but it doesn't actually restrict the protocols. This is with OpenSSL 1.1.1g. It may work correctly in OpenSSL 1.0 or in other compatible libraries... With this patch, it works correctly with OpenSSL 1.1.1g.

(ssl-ctx-set-options ctx (apply #'logior (append disabled-protocols options)))
(ssl-ctx-set-min-proto-version ctx min-ssl-version)
(ssl-ctx-set-max-proto-version ctx max-ssl-version)
(ssl-ctx-set-min-proto-version ctx +tls1-2-version+)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded value? is that a mistake?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's something I left in from testing. The first two lines (apply value from args) are correct, the third needs to be removed. I'll do that.

(verify-mode +ssl-verify-peer+)
(verify-callback nil verify-callback-supplied-p)
(cipher-list +default-cipher-list+)
(pem-password-callback 'pem-password-callback))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded indentation change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies. Emacs did it. I'll undo it.

@avodonosov
Copy link
Member

avodonosov commented Jun 21, 2020

We need to have this functionality working on all OpenSSL versions.
Also, a test is desirable. Probably the simplest way is to utilize the https://badssl.com/ - see https://github.com/cl-plus-ssl/cl-plus-ssl/blob/master/test/badssl-com.lisp for already existing tests that use this service.

Also, TravixCI SBCL tests have failed for your PR: https://travis-ci.org/github/cl-plus-ssl/cl-plus-ssl/builds/700205095?utm_source=github_status&utm_medium=notification

I'm not sure if that's because of your changes, or our Travis env has changed (we use roswell, coverall, etc). But we can't merge until this is clarified.

@jfmcbrayer
Copy link
Author

I can add a test, but I'm not sure what to do about OpenSSL versions before 1.1.0, because I think that's where those functions were added. I also have no idea about TravisCI.

@avodonosov
Copy link
Member

When I say it should work in all versions I mean at least merge of this code should not break the old versions.

If necessary, the code can branch using (openssl-is-at-least ... ) / (openssl-is-not-even ...) functions.

Although the current code doesn't break, because it doesn't try to call any functions not existing in old versions, it only passes new integer constants to as options.

BTW, if disabling protocols via the options is deprecated, it should still work? I understand deprecation as still working but maybe dropped in the future. So it is strange it doesn't work for you.

A working test for protocol limits could clarify this.

@jfmcbrayer
Copy link
Author

jfmcbrayer commented Jun 22, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants