SSL certificate of a server on Windows

2017-05-23 Thread COPIN Mathieu.
Hi, 

I want to get a server certificate from the host-name.

I know I could do something like :
> call(openssl, s_client, -showcerts, -connect, hostname:port)


But the thing is to do it without openssl because I want to run the script on 
Windows.

Any suggestions ?
Mathieu
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SSL certificate of a server on Windows

2017-05-24 Thread COPIN Mathieu.
Le mardi 23 mai 2017 19:10:11 UTC+2, Irmen de Jong a écrit :
> On 23-5-2017 10:19, COPIN Mathieu. wrote:
> > Hi, 
> > 
> > I want to get a server certificate from the host-name.
> > 
> > I know I could do something like :
> >> call(openssl, s_client, -showcerts, -connect, hostname:port)
> > 
> > 
> > But the thing is to do it without openssl because I want to run the script 
> > on Windows.
> > 
> > Any suggestions ?
> > Mathieu
> > 
> 
> I guess you mean: without calling "openssl.exe"
> 
> 
> import ssl
> cert = sll.get_server_certificate(("www.google.com", 443))
> 
> See
> https://docs.python.org/3.6/library/ssl.html#ssl.get_server_certificate
> 
> 
> 
> Irmen

That's what I neeeded, thank you !
-- 
https://mail.python.org/mailman/listinfo/python-list