Hi,
I am trying to create a key & certificate
request using openssl. This code snippet
creates the cert request & key fine as a
Java application but from within
the Tomcat the sub-process spawned by
Runtime.getRuntime().exec(...)
launches but most of the times the process
blocks/hangs/deadlock/never completes.
Any ideas of what I can try??
Note; twice in my many tries was I able to
create the key successfully. The behavior has
been erratic.
...................
public boolean createCert(String cmd, String[] env)
throws InterruptedException, IOException,
Exception
{
boolean cert_created = false;
try{
Runtime.getRuntime().exec(cmd, env);
cert_created = true;
} catch(Exception e)
{
cert_created = false;
throw(e);
}
return cert_created;
}
public static void main(String args[])
{
ServerConfigBean scb = new ServerConfigBean();
try{
String cmd = "d:\\cm\\openssl req -config
d:\\cm\\myconf.cnf -newkey rsa:512 -keyout
d:\\cm\\privkey.pem -out d:\\cm\\cert.pem";
String[] envInfo = new String[1];
envInfo[0] = "PATH d:\\cm";
scb.createCert(cmd,envInfo);
} catch(Exception e){
e.printStackTrace();
}
}
...................................
Thanks,
Naveen
=====
Naveen
650 766 8252 (Cell)
408 274 3039 (Home)
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/