My experiences with Mercurial

Emanuele Aina faina.mail at tiscali.it
Tue Jun 19 09:13:45 UTC 2007


Brendan Cully implementò:

> +            if ssl_cert:
> +                try:
> +                    from OpenSSL import SSL
> +                except ImportError:
> +                    raise util.Abort("SSL support is unavailable")
> +                ctx = SSL.Context(SSL.SSLv23_METHOD)
> +                ctx.use_privatekey_file(ssl_cert)
> +                ctx.use_certificate_file(ssl_cert)
> +                self.socket = SSL.Connection(ctx,
> +                                             socket.socket(self.address_family,
> +                                                           self.socket_type))

I've not even tried it, but maybe you can use socket.ssl instead of OpenSSL:

self.socket = socket.ssl(socket.socket(self.address_family,
                                        self.socket_type),
                          keyfile=ssl_cert,
                          certfile=ssl_cert)

-- 
Buongiorno.
Complimenti per l'ottima scelta.




More information about the Mercurial mailing list