SSL Server Socket Support in Python?

  • Thread starter =?ISO-8859-1?Q?Andr=E9_S=F8reng?=
  • Start date
?

=?ISO-8859-1?Q?Andr=E9_S=F8reng?=

I'm trying to create a SSL-enabled server in Python, and in the doc for
the socket module:

ssl(sock[, keyfile, certfile])
Initiate a SSL connection over the socket sock. keyfile is the
name of a PEM formatted
file that contains your private key. certfile is a PEM formatted
certificate chain file.
On success, a new SSLObject is returned.

So:

listen_socket = socket.socket()
listen_socket.bind((addr, port))
listen_socket.listen(10)
s, addr = listen_socket.accept()
ssl_s = socket.ssl(s, "key.pem", "cert.pem")
socket.sslerror: (1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol')

Am I missing something?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top