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

Add optional SSL key logging? #528

Closed
Keno opened this issue Apr 15, 2020 · 2 comments
Closed

Add optional SSL key logging? #528

Keno opened this issue Apr 15, 2020 · 2 comments

Comments

@Keno
Copy link
Contributor

Keno commented Apr 15, 2020

In order to debug when things go wrong, it would be useful to be able to analyze the traffic in Wireshark. Of course, in general this traffic will be encrypted. However, Wireshark supports reading in the encryption key and decrypting the traffic: https://wiki.wireshark.org/TLS. It would be great if HTTP.jl could optionally write out those keys so we can look at the traffic in wirewhark.

@Keno
Copy link
Contributor Author

Keno commented Apr 15, 2020

Ah, I see MbedTLS already has secrets_log_file. Let me try that.

@Keno Keno closed this as completed Apr 15, 2020
@Keno
Copy link
Contributor Author

Keno commented Apr 15, 2020

For my own future use, this worked fine:

@@ -652,8 +654,8 @@ function global_sslconfig(require_ssl_verification::Bool)::SSLConfig
     global default_sslconfig
     global noverify_sslconfig
     if default_sslconfig === nothing
-        default_sslconfig = SSLConfig(true)
-        noverify_sslconfig = SSLConfig(false)
+        default_sslconfig = SSLConfig(true; log_secrets="/home/keno/secrets.log")
+        noverify_sslconfig = SSLConfig(false; log_secrets="/home/keno/secrets.log")
     end
     return require_ssl_verification ? default_sslconfig : noverify_sslconfig
 end

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

No branches or pull requests

1 participant