Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » HTTPS Jetty SSL
HTTPS Jetty SSL [message #90269] Tue, 12 June 2007 08:33 Go to next message
Eclipse UserFriend
Originally posted by: baptiste.routhieau.reseau.eseo.fr

Hello,

I have an equinox framework launched with this bundles:

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.3.0.v20070430
4 ACTIVE org.apache.commons.logging_1.0.4.v200701082340
5 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.v20070427
6 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.v20070402
7 ACTIVE org.eclipse.osgi.services_3.1.100.v20060918
8 ACTIVE javax.servlet_2.4.0.v200704241052
9 ACTIVE org.mortbay.jetty_5.1.11.v200701082340
12 ACTIVE it.cnr.isti.niche.osgi.upnp.baseextra_1.0.0
14 ACTIVE it.cnr.isti.niche.osgi.upnp.basedriver_3.0.2
17 ACTIVE Servlet1_1.0.1
18 ACTIVE Servlet2_1.0.0


Actualy I can see my servlet with this address : http://localhost/servlet1/ & http://localhost/servlet2/

I need to add a secure http (https) in order to access after authentication with this address:
https://localhost/servlet1/ & https://localhost/servlet2/

What I need to do ?

Thanks
Re: HTTPS Jetty SSL [message #90360 is a reply to message #90269] Wed, 13 June 2007 02:56 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Hi Routhieau,

You can configure HTTPS support using the properties documented in
JettyConfigurator.
e.g.
Settings:

a.. name="http.enabled" type="Boolean" (default: true)
b.. name="http.port" type="Integer" (default: 0 -- first available port)
c.. name="http.host" type="String" (default: 0.0.0.0 -- all network
adapters)
d.. name="https.enabled" type="Boolean" (default: false)
e.. name="https.port" type="Integer" (default: 0 -- first available port)
f.. name="https.host" type="String" (default: 0.0.0.0 -- all network
adapters)
g.. name="ssl.keystore" type="String"
h.. name="ssl.password" type="String"
i.. name="ssl.keypassword" type="String"
j.. name="ssl.needclientauth" type="Boolean"
k.. name="ssl.wantclientauth" type="Boolean"
l.. name="ssl.protocol" type="String"
m.. name="ssl.algorithm" type="String"
n.. name="ssl.keystoretype" type="String"
o.. name="context.path" type="String"
p.. name="context.sessioninactiveinterval" type="Integer"
q.. name="other.info" type="String"
The instance of the Http Service that's created when the bundle is directly
started is configured using System Properties.
All system properties are prefixed by "org.eclipse.equinox.http.jetty." For
example: -Dorg.eclipse.equinox.http.jetty.https.enabled=true

Since the underlying engine is Jetty, this page might also be useful --
http://jetty.mortbay.org/jetty5/faq/faq_s_400-Security_t_ssl .html
The ssl.* settings are used to configure an SslListener similar to what's
done in step (4).

HTH
-Simon

"Routhieau Baptiste" <baptiste.routhieau@reseau.eseo.fr> wrote in message
news:15974853.13061181637249059.JavaMail.root@cp9.dzone.com...
> Hello,
>
> I have an equinox framework launched with this bundles:
>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.3.0.v20070430
> 4 ACTIVE org.apache.commons.logging_1.0.4.v200701082340
> 5 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.v20070427
> 6 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.v20070402
> 7 ACTIVE org.eclipse.osgi.services_3.1.100.v20060918
> 8 ACTIVE javax.servlet_2.4.0.v200704241052
> 9 ACTIVE org.mortbay.jetty_5.1.11.v200701082340
> 12 ACTIVE it.cnr.isti.niche.osgi.upnp.baseextra_1.0.0
> 14 ACTIVE it.cnr.isti.niche.osgi.upnp.basedriver_3.0.2
> 17 ACTIVE Servlet1_1.0.1
> 18 ACTIVE Servlet2_1.0.0
>
>
> Actualy I can see my servlet with this address :
> http://localhost/servlet1/ & http://localhost/servlet2/
>
> I need to add a secure http (https) in order to access after
> authentication with this address:
> https://localhost/servlet1/ & https://localhost/servlet2/
>
> What I need to do ?
>
> Thanks
Re: HTTPS Jetty SSL [message #90391 is a reply to message #90360] Wed, 13 June 2007 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: baptiste.routhieau.reseau.eseo.fr

Thanks,
I generate my keystore with keytools and I try to add in equinox the following parameters:

setprop org.eclipse.equinox.http.jetty.https.enabled=true
setprop org.eclipse.equinox.http.jetty.ssl.keystore=c:\keystore
setprop org.eclipse.equinox.http.jetty.ssl.password=password
setprop org.eclipse.equinox.http.jetty.ssl.keypassword=password

I restart the framework, and now I have this error:

13 juin 2007 09:44:34 org.mortbay.http.HttpServer doStart
INFO: Version Jetty/5.1.x
13 juin 2007 09:44:34 org.mortbay.util.Container start
INFO: Started org.mortbay.jetty.servlet.ServletHandler@482923
13 juin 2007 09:44:34 org.mortbay.util.Container start
INFO: Started HttpContext[/,/]
13 juin 2007 09:44:34 org.mortbay.http.SocketListener start
INFO: Started SocketListener on 0.0.0.0:80
<b>13 juin 2007 09:44:34 org.mortbay.util.FileResource <clinit>
INFO: Checking Resource aliases
13 juin 2007 09:44:34 org.mortbay.util.ThreadedServer start
ATTENTION: Failed to start: SslListener1@0.0.0.0:443</b>

And now my jetty bundle doesn't start...
Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.3.0.v20070530
12 ACTIVE it.cnr.isti.niche.osgi.upnp.baseextra_1.0.0
14 ACTIVE it.cnr.isti.niche.osgi.upnp.basedriver_3.0.2
18 ACTIVE CapLight_1.0.0
30 ACTIVE org.apache.commons.logging_1.0.4.v200705231731
31 ACTIVE DomoCap_1.0.1
33 ACTIVE javax.servlet_2.4.0.v200705291052
34 ACTIVE org.eclipse.osgi.services_3.1.200.v20070605
35 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.v20070606
<b>36 RESOLVED org.eclipse.equinox.http.jetty_1.0.0.v20070607</b>
37 ACTIVE org.mortbay.jetty_5.1.11.v200706061611


Maybe the framework doesn't found the keystore... Must I copy it in the jetty.jar file ???
Re: HTTPS Jetty SSL [message #90406 is a reply to message #90391] Wed, 13 June 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: baptiste.routhieau.reseau.eseo.fr

It's ok I found my error, I looking in the log files ...

I have the ISS server on on my computer...

Now I want to know how to configure the default configuration ?

When I write my configuration in
workspace\.metadata\.plugins\org.eclipse.pde.core\Equinox\co nfig.ini
the framework overwrite them...


When I write my configuration in
eclipserepertory/configuration/config.ini
the framework doesn't consider them.
Re: HTTPS Jetty SSL [message #90421 is a reply to message #90406] Wed, 13 June 2007 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: baptiste.routhieau.reseau.eseo.fr

Ok I need client authentication on my server, and I start it with this line.
setprop org.eclipse.equinox.http.jetty.ssl.needclientauth=true

When I restart my framework I get this error.

org.osgi.framework.BundleException: Exception in org.eclipse.equinox.http.jetty.internal.Activator.start() of bundle org.eclipse.equinox.http.jetty.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1018)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:350)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1118)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re sumeBundles(PackageAdminImpl.java:266)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.do ResolveBundles(PackageAdminImpl.java:234)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1. run(PackageAdminImpl.java:164)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.cr eateHttpsListener(HttpServerManager.java:196)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.up dated(HttpServerManager.java:83)
at org.eclipse.equinox.http.jetty.internal.Activator.start(Acti vator.java:52)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
... 8 more
Root exception:
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.cr eateHttpsListener(HttpServerManager.java:196)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.up dated(HttpServerManager.java:83)
at org.eclipse.equinox.http.jetty.internal.Activator.start(Acti vator.java:52)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:350)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1118)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re sumeBundles(PackageAdminImpl.java:266)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.do ResolveBundles(PackageAdminImpl.java:234)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1. run(PackageAdminImpl.java:164)
at java.lang.Thread.run(Unknown Source)


The error come from this code in HttpServerManager.class (debug mode)

String needClientAuth = (String) dictionary.get(SSL_NEEDCLIENTAUTH);
if (needClientAuth != null)
listener.setNeedClientAuth(Boolean.valueOf(needClientAuth).b ooleanValue());


It's a bug ? Because dictionary.get(SSL_NEEDCLIENTAUTH) it's a Boolean and the error is natural because we can't cast a boolean to a string.
Re: HTTPS Jetty SSL [message #90435 is a reply to message #90421] Wed, 13 June 2007 14:55 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
It definitely is a bug.
I've opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=192454 and
attached a patch.

The fix is very simple however it is "very" late for making any changes at
all in 3.3. We'll see.

Thanks.
-Simon


"Bmagic" <baptiste.routhieau@reseau.eseo.fr> wrote in message
news:1516153298.2481181741508131.JavaMail.root@cp9.dzone.com...
> Ok I need client authentication on my server, and I start it with this
> line.
> setprop org.eclipse.equinox.http.jetty.ssl.needclientauth=true
>
> When I restart my framework I get this error.
>
> org.osgi.framework.BundleException: Exception in
> org.eclipse.equinox.http.jetty.internal.Activator.start() of bundle
> org.eclipse.equinox.http.jetty.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1018)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:350)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1118)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re sumeBundles(PackageAdminImpl.java:266)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.do ResolveBundles(PackageAdminImpl.java:234)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1. run(PackageAdminImpl.java:164)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast
> to java.lang.String
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager.cr eateHttpsListener(HttpServerManager.java:196)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager.up dated(HttpServerManager.java:83)
> at
> org.eclipse.equinox.http.jetty.internal.Activator.start(Acti vator.java:52)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
> ... 8 more
> Root exception:
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to
> java.lang.String
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager.cr eateHttpsListener(HttpServerManager.java:196)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager.up dated(HttpServerManager.java:83)
> at
> org.eclipse.equinox.http.jetty.internal.Activator.start(Acti vator.java:52)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:350)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1118)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re sumeBundles(PackageAdminImpl.java:266)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl.do ResolveBundles(PackageAdminImpl.java:234)
> at
> org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1. run(PackageAdminImpl.java:164)
> at java.lang.Thread.run(Unknown Source)
>
>
> The error come from this code in HttpServerManager.class (debug mode)
>
> String needClientAuth = (String) dictionary.get(SSL_NEEDCLIENTAUTH);
> if (needClientAuth != null)
> listener.setNeedClientAuth(Boolean.valueOf(needClientAuth).b ooleanValue());
>
>
> It's a bug ? Because dictionary.get(SSL_NEEDCLIENTAUTH) it's a Boolean and
> the error is natural because we can't cast a boolean to a string.
Re: HTTPS Jetty SSL [message #90449 is a reply to message #90435] Wed, 13 June 2007 16:04 Go to previous message
Eclipse UserFriend
Originally posted by: baptiste.routhieau.reseau.eseo.fr

Ok thanks,

I write a solution after downloading the CVS Project.

Boolean needClientAuth = (Boolean) dictionary.get(SSL_NEEDCLIENTAUTH);
if (needClientAuth != null)
listener.setNeedClientAuth(needClientAuth.booleanValue());

It's the same bug for SSL_WANTCLIENTAUTH.
Previous Topic:Unbound classpath variable: 'ECLIPSE_CORE_RUNTIME'
Next Topic:Critical Problem with osgi console
Goto Forum:
  


Current Time: Fri Apr 26 22:01:52 GMT 2024

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

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

Back to the top