security - how to validate 2-way SSL certificates? -


i need validate client server's certificate.how can @ tcp level , @ http level? http use curl client library.openssl ssl library.this has done through self signed certificates only.which web server or http server need use validates client's ssl certificate?

since using self-signed certificates, can configure certificate though 1 , authorized ca. if peer presents certificate, accepted because appears in list of cas. if peer presents other certificate (or no certificate), should rejected.

you didn't programming language using libcurl, here's pycurl example verifying server:

req.setopt(pycurl.ssl_verifypeer, 1) req.setopt(pycurl.cainfo, "/the/path/to/the/certificate/we/want/the/peer/to/use") 

and of course client wants authenticate server:

req.setopt(pycurl.sslcert, "/the/certificate/the/client/will/present") req.setopt(pycurl.sslkey, "/the/private/key/that/goes/with/it/in/pem/format") 

as server side, it's easy configure well, depends web server software you're using.

edit: elaboration requested on "you can configure certificate though 1 , authorised ca".

normally, peer presents certificate, , local end validates against ca (or list of cas). ca different certificate peer's certificate. ca certificate has either directly or indirectly signed peer's certificate.

when using self-signed certificate, peer can present certificate. local end can pretend same certificate ca certificate. because certificate signed (by definition), qualifies in case being signed valid ca... since valid ca itself!.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -