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

sock.get_client_ca_list() returns empty result on an F5 server #1009

Closed
feenes opened this issue Mar 30, 2021 · 1 comment
Closed

sock.get_client_ca_list() returns empty result on an F5 server #1009

feenes opened this issue Mar 30, 2021 · 1 comment

Comments

@feenes
Copy link

feenes commented Mar 30, 2021

I try to get the list of client CAs, that a server allows.

with openssl I can call:
openssl s_client -connect hostname:443 -servername hostname and I can see the CAs after the lines

---
Acceptable client certificate CA names

for most servers I succeed with following code, that I borrowed from stackoverflow

import socket
from OpenSSL import SSL

def get_client_cert_cas(hostname, port):
    ctx = SSL.Context(SSL.SSLv23_METHOD)
    sock = SSL.Connection(ctx, socket.socket(socket.AF_INET, socket.SOCK_STREAM))
    # next line for SNI
    sock.set_tlsext_host_name(hostname.encode("utf-8"))
    sock.connect((hostname, port))
    sock.send(b"G")  # must send at least one byte
    return sock.get_client_ca_list())

For some servers (F5) however I always get an empty answer. Though the openssl command returns the correct information.

The sending of "G" is a little strange as is already mentioned in the stackoverflow article.

Is it a bug if I don't receive the correct CAs for given F5 servers or is above code wrong?

@feenes feenes changed the title sock.do_handshake() returns empty result on a F5 server sock.do_handshake() returns empty result on an F5 server Mar 30, 2021
@feenes feenes changed the title sock.do_handshake() returns empty result on an F5 server sock.get_client_ca_list() returns empty result on an F5 server Apr 2, 2021
@feenes
Copy link
Author

feenes commented Apr 2, 2021

Probably the reason is TLS1.3 Created a new issue #1010 and closed this one.

@feenes feenes closed this as completed Apr 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant