Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Browser, XULRunner, and client SSL certificates(a newbie's question on the browser component and SSL client certificates)
Browser, XULRunner, and client SSL certificates [message #661022] Tue, 22 March 2011 18:12 Go to next message
Mark Fishman is currently offline Mark FishmanFriend
Messages: 27
Registered: March 2011
Junior Member
This is a pretty newbie question but no matter how hard I look I can not find an answer for it so I am hoping someone can point me in the right direction.

I am embedding a Browser component in my RCP/SWT application. The page I want to connect to uses two way SSL authentication. When I set up my Browser component like:

browser = new Browser(parent, SWT.NONE);

everything works as expected and it reads my certificate from my default browser's certificate store and I authenticate right in.

Unfortunately, I need to make sure that I always use Firefox, regardless of what the default browser is, and so I am trying to get the browser to use XULRunner 1.9.2.

For a quick test, I specified a org.eclipse.swt.browser.XULRunnerPath on my startup line and changed the browser line to:

browser = new Browser(parent, SWT.MOZILLA);

Everything worked correctly and XULRunner was used rather than IE, since I was on Windows, but no certificate was presented to the server nor was I given an option to load one in.

Does anyone know how to set a user's certificate in the Browser object or else load it into XULRunner's certificate store? I don't mind if I have to write a dialog to import the user's certificate and store it somewhere but I just do not see any handles for doing this.

Thanks a lot.

-- Mark
Re: Browser, XULRunner, and client SSL certificates [message #662175 is a reply to message #661022] Tue, 29 March 2011 15:04 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Mark,

When embedding XULRunner, eclipse creates a profile that's separate from the
profile(s) being used by Firefox. On Windows it's located in
<ApplicationDataDirectory>/Mozilla/eclipse, which (for example) on XP
resolves to C:\Documents and Settings\<user>\Application
Data\Mozilla\eclipse.

This question has been previously asked, see
http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg058 99.html , though
it's not clear if they found a successful resolution or not. The Browser
does not provide a straight-forward way to import a certificate like this,
but there are a couple of possibilties you can try:

1. The link above references a couple of mozilla tools for modifying a
profile's certificate store, which may be helpful.

2. You could use JavaXPCOM to access XULRunner's internals and
programmatically import it this way. This may or may not be a significant
effort to implement, I haven't tried before. If you want to investigate
this see http://www.eclipse.org/swt/faq.php#howusejavaxpcom for info on
getting started with JavaXPCOM. Once you have a basic case of JavaXPCOM
working (eg.- Snippet267), you could then probably wade through the firefox
source code to locate the services and interfaces to use to do what you
want.

HTH,
Grant


<mfishm1@verizon.net> wrote in message news:imaod5$t6h$1@news.eclipse.org...
> This is a pretty newbie question but no matter how hard I look I can not
> find an answer for it so I am hoping someone can point me in the right
> direction.
>
> I am embedding a Browser component in my RCP/SWT application. The page I
> want to connect to uses two way SSL authentication. When I set up my
> Browser component like:
>
> browser = new Browser(parent, SWT.NONE);
>
> everything works as expected and it reads my certificate from my default
> browser's certificate store and I authenticate right in.
>
> Unfortunately, I need to make sure that I always use Firefox, regardless
> of what the default browser is, and so I am trying to get the browser to
> use XULRunner 1.9.2.
> For a quick test, I specified a org.eclipse.swt.browser.XULRunnerPath on
> my startup line and changed the browser line to:
>
> browser = new Browser(parent, SWT.MOZILLA);
>
> Everything worked correctly and XULRunner was used rather than IE, since I
> was on Windows, but no certificate was presented to the server nor was I
> given an option to load one in.
>
> Does anyone know how to set a user's certificate in the Browser object or
> else load it into XULRunner's certificate store? I don't mind if I have
> to write a dialog to import the user's certificate and store it somewhere
> but I just do not see any handles for doing this.
>
> Thanks a lot.
>
> -- Mark
>
Previous Topic:How to best define static color constants
Next Topic:Autocompleting combo boxes
Goto Forum:
  


Current Time: Fri Apr 26 08:59:04 GMT 2024

Powered by FUDForum. Page generated in 0.02972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top