Friday, April 18, 2008

Something for Psi Users

For those that use the old ssl certs to connect to connect to your favorite jabber server I dusted off this old batch script that creates ssl certs in the xml format required for Psi. I found it after looking around the Psi-wiki for a how to on making certificates since the main xml cert file didn't have one for the server i used at the time. I adapted it from a bash script, and this worked just fine for me. I tested it last night and it still works just like it should.

Please not that %1 is for the server name and %2 is for the port number.

ECHO ^>>%1.xml
ECHO ^>>%1.xml
ECHO ^>>%1.xml
::# Get server certificate. Convert to x509. Strip out lines
openssl s_client -connect %1:%2 | openssl x509 -outform DER | openssl enc -a -A >>%1.xml
ECHO ^<^/store^>>>%1.xml
ECHO ^<^/certificate^>>>%1.xml
ECHO ^<^/data^>>>%1.xml

This script even adds in the tags needed for the xml-ssl certificate format used by PSI.