From: Alan K. <jyt...@xh...> - 2007-02-15 22:29:03
|
[A M <ar...@gm...>] >> >>URLError: <urlopen error unknown url type: https> >> >> Does Jython supports SSL protocol and it is a matter of >> configuration, or do I have to install SSL support manually >> via Python libraries? [Charlie Groves] > Jython doesn't support ssl through Python libraries as the C code for > that hasn't been ported. The SSL support in Java works fine though. > See http://article.gmane.org/gmane.comp.lang.jython.user/5179 for more > details. I've implemented cpython-compatible client-side ssl support in jython's socket.py. The java ssl support does indeed work fine: there is a direct mapping from cpython's approach to java apis. As a test while developing, I've gotten the example from the cpython documentation working: http://docs.python.org/lib/socket-example.html this is its output on jdk 1.4.2 'CN=www.verisign.com, OU=Terms of use at www.verisign.com/rpa (c)05, OU=Production Services L=Mountain View, ST=California, C=US, O="VeriSign, Inc.", OID.1.3.6.1.4.1.311.60.2.1.1=Wilmington,OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, OID.1.3.6.1.4.1.311.60.2.1.3=US, SERIALNUMBER=2497886' 'CN=VeriSign Class 3 Extended Validation SSL SGC CA, OU=Terms of use at https://www.verisig.com/rpa (c)06, OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US' Notice that this is not quite the same as the "ASN.1" representation produced by cpython : different separators and different order. I'll be making the code available as soon as I've added cpython compatible exceptions to it. Charlie, is a patch for this the right way to go? I think it's a good candidate for inclusion in the jython code base. It's about 50 lines of standalone code, but will grow a little when I add the exceptions. I'll be writing a small test suite for it too. The cpython 2.5 test_socket_ssl.py doesn't really have wide coverage. What to do with that test suite? Regards, Alan. |