pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/af2b8f6845e31dd6ab3bb0bac41b19a0e023fd61

97560d244c08.css" /> gh-113332: Simplify calls to SSL_(CTX_)set_verify in _ssl.c (#113333) · python/cpython@af2b8f6 · GitHub
Skip to content

Commit af2b8f6

Browse files
authored
gh-113332: Simplify calls to SSL_(CTX_)set_verify in _ssl.c (#113333)
_ssl.c currently tries to preserve the verification callback, but at no point does it ever set one. Just pass in NULL.
1 parent 2b53c76 commit af2b8f6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Modules/_ssl.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
893893
* only in combination with SSL_VERIFY_PEER flag. */
894894
int mode = SSL_get_verify_mode(self->ssl);
895895
if (mode & SSL_VERIFY_PEER) {
896-
int (*verify_cb)(int, X509_STORE_CTX *) = NULL;
897-
verify_cb = SSL_get_verify_callback(self->ssl);
898896
mode |= SSL_VERIFY_POST_HANDSHAKE;
899-
SSL_set_verify(self->ssl, mode, verify_cb);
897+
SSL_set_verify(self->ssl, mode, NULL);
900898
}
901899
} else {
902900
/* client socket */
@@ -2997,7 +2995,6 @@ static int
29972995
_set_verify_mode(PySSLContext *self, enum py_ssl_cert_requirements n)
29982996
{
29992997
int mode;
3000-
int (*verify_cb)(int, X509_STORE_CTX *) = NULL;
30012998

30022999
switch(n) {
30033000
case PY_SSL_CERT_NONE:
@@ -3018,9 +3015,7 @@ _set_verify_mode(PySSLContext *self, enum py_ssl_cert_requirements n)
30183015
/* bpo-37428: newPySSLSocket() sets SSL_VERIFY_POST_HANDSHAKE flag for
30193016
* server sockets and SSL_set_post_handshake_auth() for client. */
30203017

3021-
/* keep current verify cb */
3022-
verify_cb = SSL_CTX_get_verify_callback(self->ctx);
3023-
SSL_CTX_set_verify(self->ctx, mode, verify_cb);
3018+
SSL_CTX_set_verify(self->ctx, mode, NULL);
30243019
return 0;
30253020
}
30263021

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy