You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by nutrition <ta...@gmail.com> on 2011/08/03 00:13:29 UTC

karaf+jetty+https

Hi, I'm using karaf 2.2.2 and my goal is to using karaf as a simple file
server over https. First I verified that I can access karaf over http.
However I'm having some problems when I try to start the jetty feature with
https configured. My configuration for jetty is copied from the config file
jetty-ssl.xml from the jetty distro iteslf and looks like the one below.
When I start karaf I get the following errors. Has anyone got jetty working
with https within karaf? Thanks for any help.

<Configure id="Server" class="org.eclipse.jetty.server.Server">

  
  
  <New id="sslContextFactory"
class="org.eclipse.jetty.http.ssl.SslContextFactory">
    <Set name="KeyStore"><Property name="jetty.home" default="."
/>/etc/keystore</Set>
    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
    <Set name="TrustStore"><Property name="jetty.home" default="."
/>/etc/keystore</Set>
    <Set
name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
  </New>

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <Arg><Ref id="sslContextFactory" /></Arg>
        <Set name="Port">8443</Set>
        <Set name="maxIdleTime">30000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="AcceptQueueSize">100</Set>
      </New>
    </Arg>
  </Call>
</Configure>

 54 - org.eclipse.jetty.util - 7.4.2.v20110526 | Config error at <New
id="sslContextFactory" class="org.eclipse.jetty.http.ssl.SslContextFactory">
    <Set name="KeyStore"><Property name="jetty.home"
default="."/>/etc/keystore</Set>
    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
    <Set name="TrustStore"><Property name="jetty.home"
default="."/>/etc/keystore</Set>
    <Set
name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
  </New>
14:46:45,689 | ERROR | g.ops4j.pax.web) | JettyServerImpl                  |
e.jetty.internal.JettyServerImpl  100 | 71 - org.ops4j.pax.web.pax-web-jetty
- 1.0.4 | java.lang.reflect.InvocationTargetException
14:46:45,696 | INFO  | g.ops4j.pax.web) | JettyServerImpl                  |
e.jetty.internal.JettyServerImpl  117 | 71 - org.ops4j.pax.web.pax-web-jetty
- 1.0.4 | Pax Web available at [0.0.0.0]:[8181]
14:46:45,708 | WARN  | g.ops4j.pax.web) | NIOSocketConnectorWrapper        |
ternal.NIOSocketConnectorWrapper   45 | 71 - org.ops4j.pax.web.pax-web-jetty
- 1.0.4 | Connection on port 8181 cannot be open. Reason: null


--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-jetty-https-tp3220425p3220425.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf+jetty+https

Posted by Taro Fukunaga <ta...@gmail.com>.
Hi Achim,

I finally got things working. Yeah I think I learned from many mistakes that
if I have a property file and I still want to load jetty.xml, there's a
property for that. Now I can browse using https.

Thanks a lot for the links.

Taro

--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-jetty-https-tp3220425p3223361.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf+jetty+https

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

in karaf we use pax web as the wrapper around Jetty to deliver web content
therefore please take a look at [1] to see how to configure Pax Web.
If you have certain specialties that are not covered through the std. pax web
configuration part you are still able to enhance Jetty through the jetty.xml.
For these specialties please see also [2].

Regards, Achim


[1] - http://team.ops4j.org/wiki/display/paxweb/SSL+Configuration
[2] - http://team.ops4j.org/wiki/display/paxweb/Advanced+Jetty+Configuration

2011/8/3 nutrition <ta...@gmail.com>:
> Hi, I'm using karaf 2.2.2 and my goal is to using karaf as a simple file
> server over https. First I verified that I can access karaf over http.
> However I'm having some problems when I try to start the jetty feature with
> https configured. My configuration for jetty is copied from the config file
> jetty-ssl.xml from the jetty distro iteslf and looks like the one below.
> When I start karaf I get the following errors. Has anyone got jetty working
> with https within karaf? Thanks for any help.
>
> <Configure id="Server" class="org.eclipse.jetty.server.Server">
>
>
>
>  <New id="sslContextFactory"
> class="org.eclipse.jetty.http.ssl.SslContextFactory">
>    <Set name="KeyStore"><Property name="jetty.home" default="."
> />/etc/keystore</Set>
>    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
>    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
>    <Set name="TrustStore"><Property name="jetty.home" default="."
> />/etc/keystore</Set>
>    <Set
> name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
>  </New>
>
>  <Call name="addConnector">
>    <Arg>
>      <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
>        <Arg><Ref id="sslContextFactory" /></Arg>
>        <Set name="Port">8443</Set>
>        <Set name="maxIdleTime">30000</Set>
>        <Set name="Acceptors">2</Set>
>        <Set name="AcceptQueueSize">100</Set>
>      </New>
>    </Arg>
>  </Call>
> </Configure>
>
>  54 - org.eclipse.jetty.util - 7.4.2.v20110526 | Config error at <New
> id="sslContextFactory" class="org.eclipse.jetty.http.ssl.SslContextFactory">
>    <Set name="KeyStore"><Property name="jetty.home"
> default="."/>/etc/keystore</Set>
>    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
>    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
>    <Set name="TrustStore"><Property name="jetty.home"
> default="."/>/etc/keystore</Set>
>    <Set
> name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
>  </New>
> 14:46:45,689 | ERROR | g.ops4j.pax.web) | JettyServerImpl                  |
> e.jetty.internal.JettyServerImpl  100 | 71 - org.ops4j.pax.web.pax-web-jetty
> - 1.0.4 | java.lang.reflect.InvocationTargetException
> 14:46:45,696 | INFO  | g.ops4j.pax.web) | JettyServerImpl                  |
> e.jetty.internal.JettyServerImpl  117 | 71 - org.ops4j.pax.web.pax-web-jetty
> - 1.0.4 | Pax Web available at [0.0.0.0]:[8181]
> 14:46:45,708 | WARN  | g.ops4j.pax.web) | NIOSocketConnectorWrapper        |
> ternal.NIOSocketConnectorWrapper   45 | 71 - org.ops4j.pax.web.pax-web-jetty
> - 1.0.4 | Connection on port 8181 cannot be open. Reason: null
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-jetty-https-tp3220425p3220425.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
--
*Achim Nierbeck*


Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>