[go: up one dir, main page]

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

Clients certificate common name validation #538

Open
sourabhyadavgit opened this issue Aug 2, 2020 · 0 comments
Open

Clients certificate common name validation #538

sourabhyadavgit opened this issue Aug 2, 2020 · 0 comments

Comments

@sourabhyadavgit
Copy link
sourabhyadavgit commented Aug 2, 2020

Hi,
I was working towards making use of openssl command getpeercert() to validate clients certificate on common name and if possible with SAN validation. Ie subject field validation.
Intention is to make it password less Authentication with full mutual authentication.
Will dummyAuthrizer support it?
Issue with unix authorizer is that unix id's are AD based.
So best is to use only cert Auth and dummyauthrizer.
Here is what I was trying but connection was hanging without any cert from client end printed.

class MyHandler(FTPHandler):

def on_connect(self):
    print "%s:%s connected" % (self.remote_ip, self.remote_port)

Print(Self.socket.get_peer_certificate())
Print(self.get_repr_info())

Def main():
Context = ssl.SSLContext(ssl.protocol_tlsv1_2)
Context.load_verify_location(cafile)
Context. Load_cert_chain(certfile,keyfile)
Handler = myhandler
Handler.certfile= certfile
Handler.keyfile=keyfile
Handler.ssl_protocol = SSL.TLSv1_2_METHOD

If i can get and print client cert I intend to decrypt it further to check and match various fields like common name and SAN validations but at this point I can't even print what cert and ciphers are being used on connection.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant