Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-34271: Add ssl debugging helpers (GH-10031)#10031

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tiran merged 2 commits intopython:masterfromtiran:bpo-34271-ssldebug
May 31, 2019

Conversation

@tiran
Copy link
Member

@tirantiran commentedOct 21, 2018
edited by bedevere-bot
Loading

The ssl module now can dump key material to a keylog file and trace TLS
protocol messages with a tracing callback. The default and stdlib
contexts also support SSLKEYLOGFILE env var.

  • API review
  • whatsnew entry
  • More tests

https://bugs.python.org/issue34271

thehesiod, cyberbutler, and obestwalter reacted with thumbs up emoji
@jmfrank63
Copy link

I made a first test setting the env variableSSLKEYLOGFILE from python and creating the file from there as well. Currently the~ resolution does not seem to work, but besides that using the simple client socket example from the ssl docs I was able to grab the keys and log them into the file the env variable was pointing to. I was on a Mac and installedopenssl@1.1 via homebrew.

@tiran
Copy link
MemberAuthor

TheSSLKEYLOGFILE only works, if you

  • have OpenSSL 1.1.1 installed. OpenSSL 1.1.0 or 1.0.2 don't have a keylog callback API. Linux distributions like Debian and Fedora just started to include 1.1.1 in their latest test versions.
  • usessl.create_default_context(). A customssl.SSLContext doesn't useSSLKEYLOGFILE.

I decided against expanding~ to user's home directory, because neither curl nor NSS expand them.

@jmfrank63
Copy link

I wrote some basic examples showing this works very well. Thanks tohttps://github.com/jmfrank63/ssl-examples/commits?author=nikosgraser for providing the requests example.

@tirantiranforce-pushed thebpo-34271-ssldebug branch 3 times, most recently frome938b5b to3f17e9fCompareMay 29, 2019 09:42
@tiran
Copy link
MemberAuthor

@zooba Could you please do me a favor and try the patch on Windows? One of the test cases is failing on Windows and I don't understand why.

======================================================================FAIL: test_keylog_env (test.test_ssl.TestSSLDebug)----------------------------------------------------------------------Traceback (most recent call last):  File "C:\projects\cpython\lib\test\test_ssl.py", line 4488, in test_keylog_env    self.assertEqual(ctx.keylog_filename, support.TESTFN)AssertionError: None != '@test_4872_tmp'----------------------------------------------------------------------

@tirantiran changed the title[WIP] bpo-34271: Add ssl debugging helpersbpo-34271: Add ssl debugging helpersMay 29, 2019
@tirantiranforce-pushed thebpo-34271-ssldebug branch 4 times, most recently fromea3fd14 to8bbb6dfCompareMay 30, 2019 12:50
@tiran
Copy link
MemberAuthor

@zooba One Windows test case was failing becauseignore_environment flag was set. I'm now skipping the test case if the flag is set.

@tirantiran requested a review fromvstinnerMay 30, 2019 20:55
The ssl module now can dump key material to a keylog file and trace TLSprotocol messages with a tracing callback. The default and stdlibcontexts also support SSLKEYLOGFILE env var.
The msg_callback and related enums are now private members. The featureis designed for internal debugging and not for end users.Signed-off-by: Christian Heimes <christian@python.org>
@tirantiran changed the titlebpo-34271: Add ssl debugging helpersbpo-34271: Add ssl debugging helpers (GH-10031)May 31, 2019
@tirantiran merged commitc7f7069 intopython:masterMay 31, 2019
@tirantiran deleted the bpo-34271-ssldebug branchMay 31, 2019 09:44
DinoV pushed a commit to DinoV/cpython that referenced this pull requestJan 14, 2020
The ssl module now can dump key material to a keylog file and trace TLSprotocol messages with a tracing callback. The default and stdlibcontexts also support SSLKEYLOGFILE env var.The msg_callback and related enums are private members. The featureis designed for internal debugging and not for end users.Signed-off-by: Christian Heimes <christian@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@njsmithnjsmithAwaiting requested review from njsmith

@zoobazoobaAwaiting requested review from zooba

@vstinnervstinnerAwaiting requested review from vstinner

1 more reviewer

@reaperhulkreaperhulkreaperhulk left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@tiran@jmfrank63@reaperhulk@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp