Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 150175 - Handling a jira site over SSL requires tweaking my runtime cert store (annoying)
Summary: Handling a jira site over SSL requires tweaking my runtime cert store (annoying)
Status: RESOLVED DUPLICATE of bug 147888
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 0.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-10 12:39 EDT by Andy Brook CLA
Modified: 2006-07-27 17:07 EDT (History)
1 user (show)

See Also:


Attachments
Provides example of creating a TRUST cert store in a plugins state folder from a plugins resource. (4.64 KB, text/plain)
2006-07-10 12:45 EDT, Andy Brook CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Brook CLA 2006-07-10 12:39:35 EDT
I seem to have to import SSL keys into my Eclipse runtime cacerts file in order for java to allow a SSL socket connection to a SSL secured Jira server.  I have this second hand as the recommended way of doing things, I have a better way Id like to suggest, having had to do this very thing in a plugin project.

This all works by pointing some environment variables to a manufactured keystore kept in the plugins state path:
			System.getProperties().setProperty("javax.net.ssl.trustStore", af.getAbsolutePath()); //must be a resolvable FILE
			System.getProperties().setProperty("javax.net.ssl.trustStorePassword", "changeit");


First you need to get the cert from the server, then you need to import it into a keystore and use it.  Ignoring how you get the cert in the first place, the attachment shows some cut and pasted methods that put the cert into a keystore in the plugines state location, update an environment variable and bobs your uncle without any JRE cacert tweaks.

I glossed over the question of how to extract the cert, I havent had to do this for my need and havent thought about it a great deal.  I guess you could use 'openssl s_client -connect theserver:443' and chop the cert out of the stream, but obv, this is native 'linux' and not java.  Maybe someone can figure this out...


comments?
Comment 1 Andy Brook CLA 2006-07-10 12:45:28 EDT
Created attachment 46019 [details]
Provides example of creating a TRUST cert store in a plugins state folder from a plugins resource.

The tricky bit is extracting a SSL Cert from a web server, IE has a neat way of doing this, shame firefox doesnt.  I havent thought how this can be done programatically.
Comment 2 Eugene Kuleshov CLA 2006-07-10 17:36:48 EDT
Looks like a duplicate of bug 147888. Also note that System.setProperty() generally is really bad idea when running from shared/controlled runtime where it can easily interfere with other plugins.
Comment 3 Mik Kersten CLA 2006-07-27 17:07:01 EDT
Andy, while waiting on bug 147888 please consider adding some tips on getting this going to: 

http://wiki.eclipse.org/index.php/Mylar_Contributor_Reference#JIRA

*** This bug has been marked as a duplicate of 147888 ***