-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SSL/TLS certificate checking #782 #6664
Conversation
0e82e56
to
0f01b01
Compare
Btw, were you able to test this on macOS and Windows? |
0f01b01
to
0b3ca87
Compare
174f997
to
26d42cc
Compare
8543fdf
to
797bbf5
Compare
@dom96 as discussed on IRC, the cert validation requires OpenSSL 1.1 which is not available on the buildbots (and therefore breaks Nimble). Do we want to: |
@FedericoCeratto any idea how python et al are handling this currently, since they've all started doing cert validation? |
@jamiesonbecker replying to you in #5000 |
133d33f
to
4ad51bc
Compare
4ad51bc
to
fdb3a91
Compare
fdb3a91
to
73b6c62
Compare
Rebase? Next release is just around the corner. |
73b6c62
to
d09e03c
Compare
Rebased. We need to discuss what to do to fix tests and support Nimble: |
Unfortunately I don't have an opinion on this question. :-) |
d09e03c
to
8904ec7
Compare
8db9168
to
095d12a
Compare
f8039d0
to
af40549
Compare
a37365a
to
0f51d44
Compare
0f51d44
to
c686535
Compare
Rebased. |
c686535
to
6a158ee
Compare
lib/wrappers/openssl.nim
Outdated
let cert = d2i_X509(certbytes) | ||
let encoded = cert.i2d_X509() | ||
assert encoded == certbytes | ||
echo "OK" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove that line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a test..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if it's a test, it's not needed; see for example isMainModule tests inside lib/pure/math.nim
logging should be reserved for the exceptional, not the expected
is a good rule of thumb
|
||
else: | ||
echo "ERROR: unexpected env variable value" | ||
quit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace all instances of quit
with doAssert false, optional_informative_string
=> much friendlier for debugging when things go wrong thanks to stacktrace etc; plus doesn't break try/catch etc
see quit considered evil: bypasses defer
and try/catch/finally
which might do important cleanups - Nim forum : quit considered evil: bypasses defer
and try/catch/finally
which might do important cleanups - Nim forum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test.. We don't want a stacktrace here because it can change with unrelated changes
6a158ee
to
84d4f96
Compare
Rebased. |
Remove NIM_SSL_CERT_VALIDATION env var tests/untestable/thttpclient_ssl.nim ran successfully on Linux with libssl 1.1.1d
0ea66b8
to
290d671
Compare
Status update: the tests are passing on Linux and OSX in #13697 and the Github action allows running the (heavy) tests only on changes related to SSL. The build is broken on Windows possibly due to the SSL version. |
Prevent loading symbols that are not defined on older SSL libs
..when nimDisableCertificateValidation is set
The contents of this PR, plus a dedicated Github action to test it have been merged in #13697 |
Closes #782 and #784