[cryptography] "best practices" for hostname validation when using JSSE

Patrick Pelletier code at funwithsoftware.org
Fri Aug 9 15:03:43 EDT 2013


One thing mentioned in the "Most Dangerous Code in the World" paper  
(and I've verified experimentally) is that JSSE doesn't validate the  
hostname against the X.509 certificate, so if one uses JSSE naively,  
one is open to man-in-the-middle attacks.  The best solution I've been  
able to figure out is to "borrow" the hostname validation code from  
Apache HttpComponents.  But I'm curious what other people who use JSSE  
are doing, and if there's a "best practice" for doing this.

Apologies if this isn't on-topic for this list; I know you guys mostly  
discuss higher-level issues, rather than APIs.  I already tried asking  
on Stack Overflow, and they said it was off-topic for Stack Overflow:

http://stackoverflow.com/questions/18139448/how-should-i-do-hostname-validation-when-using-jsse

So, a meta-question would be: where is the right place to ask this  
question?  I haven't been able to find a JSSE-specific mailing list.

Thanks,

--Patrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/cryptography/attachments/20130809/cf2cf4bb/attachment.html>


More information about the cryptography mailing list