SSL/TLS - am I doing it right?
Mon Mar 13 13:37:07 CET 2006
"Frank Millman" <frank at chagford.com> writes:
> What I have not understood is how to prevent this. How can the client
> distinguish between a valid server and a fraudulent one? If it obtains
> the server credentials dynamically, the fraudulent server can supply
> fraudulent credentials. If somehow the client must know in advance what
> the credentials are, then these can only be as secure as the parameter
> that tells the client how to connect in the first place.
The client and the server each needs to know the public key of the
"certificate authority" (or CA) that issued the root of the chain of
certificates that the other side presents. For a public server you'd
use a commercial CA. For a local network you could run your own CA;
for example, OpenSSL (www.openssl.org) comes with a simple Perl script
that acts as a rudimentary CA.
Note that TLSLite at the moment doesn't know how to authenticate
certificate chains all by itself without external libraries. I didn't
look at your code sample closely enough to figure out whether you were
using OpenSSL or M2Crypto in a way that takes care of that.
> I am sure I am missing the point somewhere. Any advice, or links to
> literature that explain this in more detail, will be much appreciated.
This might help:
More information about the Python-list