Issue 25404: ssl.SSLcontext.load_dh_params() does not handle unicode filenames properly (original ) (raw ) Issue25404
Created on 2015-10-14 12:36 by schlenk , last changed 2022-04-11 14:58 by admin . This issue is now closed .
Pull Requests
URL
Status
Linked
Edit
PR 3459
merged
christian.heimes,2017-09-08 18:07
Messages (5)
msg252987 - (view)
Author: Michael Schlenker (schlenk)
Date: 2015-10-14 12:36
The load_dh_params() method of SSLContext does not properly handle unicode filenames on Windows (like load_verify_location() does). It should convert any passed unicode path to the filesystem encoding. This is already fixed in the 3.x head revision, by loading the file via python instead of the OpenSSL BIO functions, but is broken in 2.7.10. Currently it silently works for most files due to an implicit conversion to string, but with the wrong default encoding instead of filesystem encoding.
msg252988 - (view)
Author: STINNER Victor (vstinner) *
Date: 2015-10-14 12:38
Right. The workaround is to encode manually the filename: filename = filename.encode(sys.getfilesystemencoding())
msg252992 - (view)
Author: Michael Schlenker (schlenk)
Date: 2015-10-14 13:29
Yes, the workaround works. Would be nice if this could be fixed in a 2.7.11...
msg301488 - (view)
Author: Christian Heimes (christian.heimes) *
Date: 2017-09-06 17:22
Patch welcome :)
msg312784 - (view)
Author: Christian Heimes (christian.heimes) *
Date: 2018-02-25 08:48
New changeset 6e8f395001b026daea047cf225dcca5a973ae824 by Christian Heimes in branch '2.7': bpo-25404 : SSLContext.load_dh_params() non-ASCII path (GH-3459 ) https://github.com/python/cpython/commit/6e8f395001b026daea047cf225dcca5a973ae824
History
Date
User
Action
Args
2022-04-11 14:58:22
admin
set
github: 69590
2018-02-25 08:48:17
christian.heimes
set
status: open -> closedresolution: fixedstage: patch review -> resolved
2018-02-25 08:48:04
christian.heimes
set
messages: +
2017-09-08 18:08:32
christian.heimes
set
keywords: - patch assignee: christian.heimes
2017-09-08 18:07:56
christian.heimes
set
keywords: + patch pull_requests: + <pull%5Frequest3453>
2017-09-06 17:22:15
christian.heimes
set
keywords: + easy (C) assignee: christian.heimes -> (no value)messages: +
2016-09-15 07:49:59
christian.heimes
set
assignee: christian.heimes components: + SSLnosy: + christian.heimes
2016-09-08 23:10:13
christian.heimes
set
stage: patch review
2015-10-14 13:29:13
schlenk
set
messages: +
2015-10-14 12:38:27
vstinner
set
messages: +
2015-10-14 12:37:39
vstinner
set
nosy: + ezio.melotti , zach.ware , paul.moore , tim.golden , vstinner , steve.dower components: + Unicode, Windows
2015-10-14 12:36:27
schlenk
create