Skip to content
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

using OpenSSL disables certificate checks by default? #937

Closed
tanmaykm opened this issue Oct 14, 2022 · 0 comments · Fixed by #941
Closed

using OpenSSL disables certificate checks by default? #937

tanmaykm opened this issue Oct 14, 2022 · 0 comments · Fixed by #941

Comments

@tanmaykm
Copy link
Member

  • Julia 1.7.3
  • HTTP.jl 1.4.1
  • MbedTLS.jl 1.1.6
  • OpenSSL 1.2.1

When not using OpenSSL, HTTP client requests check for validity of server certificate.

julia> using HTTP

julia> HTTP.get("https://expired.badssl.com/")
ERROR: HTTP.Exceptions.ConnectError("https://expired.badssl.com/", MbedTLS error code -9984: X509 - Certificate verification failed, e.g. CRL, CA or signature check failed)
Stacktrace:
...

julia> HTTP.get("https://expired.badssl.com/"; require_ssl_verification=false)
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
...

But they don't seem to be doing that when OpenSSL is used:

julia> using OpenSSL

julia> HTTP.SOCKET_TYPE_TLS[] = OpenSSL.SSLStream
SSLStream

julia> HTTP.get("https://expired.badssl.com/")
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
...
quinnj added a commit to JuliaWeb/OpenSSL.jl that referenced this issue Oct 17, 2022
quinnj added a commit to JuliaWeb/OpenSSL.jl that referenced this issue Oct 17, 2022
quinnj added a commit that referenced this issue Oct 17, 2022
Fixes #937.

There's a corresponding [OpenSSL PR](JuliaWeb/OpenSSL.jl#5)
that fixes the actual verification bug, but I noticed some cleanup needed along the way.

Notably:
  * Fix issue if you were using OpenSSL w/ a proxy, we would try to do the proxy upgrade
    still using MbedTLS
  * Create a default global `OpenSSL.SSLContext` that gets reused for every individual
    connection (as intended by the library)
quinnj added a commit that referenced this issue Oct 17, 2022
* Cleanup OpenSSL implementation

Fixes #937.

There's a corresponding [OpenSSL PR](JuliaWeb/OpenSSL.jl#5)
that fixes the actual verification bug, but I noticed some cleanup needed along the way.

Notably:
  * Fix issue if you were using OpenSSL w/ a proxy, we would try to do the proxy upgrade
    still using MbedTLS
  * Create a default global `OpenSSL.SSLContext` that gets reused for every individual
    connection (as intended by the library)

* bump OpenSSL compat
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 a pull request may close this issue.

1 participant