File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2844,15 +2844,13 @@ PySSL_get_session(PySSLSocket *self, void *closure) {
2844
2844
PySSLSession * pysess ;
2845
2845
SSL_SESSION * session ;
2846
2846
2847
- /* duplicate session as workaround for session bug in OpenSSL 1.1.0,
2848
- * https://github.com/openssl/openssl/issues/1550 */
2849
- session = SSL_get0_session (self -> ssl ); /* borrowed reference */
2847
+ /* See discussion on https://github.com/python/cpython/pull/123249 and
2848
+ * older discussion on https://github.com/openssl/openssl/issues/1550.
2849
+ * CPython is NOT doing the right thing here. */
2850
+ session = SSL_get1_session (self -> ssl );
2850
2851
if (session == NULL ) {
2851
2852
Py_RETURN_NONE ;
2852
2853
}
2853
- if ((session = _ssl_session_dup (session )) == NULL ) {
2854
- return NULL ;
2855
- }
2856
2854
pysess = PyObject_GC_New (PySSLSession , self -> ctx -> state -> PySSLSession_Type );
2857
2855
if (pysess == NULL ) {
2858
2856
SSL_SESSION_free (session );
You can’t perform that action at this time.
0 commit comments