Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section explains how to add SSL SelectChannelSelector in Adeptia Jetty. 

...

  1. Go to /ServerKernel/etc/jetty folder and open the Jetty.xml file.
  2. Add an sslContextFactory within sslContextFactory definition section as shown below.

     

    Code Block
    <!--sslContextFactory
    definition 
     definition
          *To add SslContextFactory( which is used in SslSelectChannelConnector definition)
    modify id of SslContextFactory as it should be different from already defined sslContextFactory.
    modify KeyStore properties as per the requirement.
    <New
    
          * modify id of SslContextFactory as it should be different from already defined sslContextFactory.
          * modify KeyStore properties as per the requirement.
    <New id="sslContextFactory2"
     
    
    class="org.eclipse.jetty.http.ssl.SslContextFactory">
    
        <Set
    name="KeyStore"><Property name="jetty.home"
     
    
    default="."
     
     />/etc/jetty/custom.keystore</Set>
    
        <Set
    name="KeyStorePassword">password</Set>
    
        <Set
    name="KeyManagerPassword">password</Set>
    
        <Set name="TrustStore"><Property
    name="jetty.home"
     
     default="."
     
     />/etc/jetty/custom1.keystore</Set>
    
        <Set
    name="TrustStorePassword">password</Set>
    
    </New>
  3. Define the following details within the new sslContextFactory, which you have defined:
    1. Path and Name of the keystore file.
    2. Keystore password
    3. Key Manager password
    4. Path and Name of the truststore.
    5. Truststore password
  4. Now add the SslSelectChannelConnector within Connector's definition as shown below.

     

    Code Block
    <!-- Connector's
    definition
     
     To add SslSelectChannelConnector modify below items:
    *modify id as per the declared sslContextFactory(user has to define new sslContextFactory if new keystore for this connector is required)
    *Declaration (refer to the section sslContextFactory definition).
    *modify connector name from HttpsConnectorB to the required name.
    *modify Port value as per the requirement
     
    <Item>
    <New 
     definition
          To add SslSelectChannelConnector modify below items:
          * modify id as per the declared sslContextFactory(user has to define new sslContextFactory if new keystore for this connector is required) 
            Declaration (refer to the section sslContextFactory definition).
          * modify connector name from HttpsConnectorB to the required name. 
          * modify Port value as per the requirement
          <Item>
           <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
    <Arg><Ref
           
           <Arg><Ref id="sslContextFactory2"
     
     /></Arg>
    <Set
    
           <Set name="name">HttpsConnectorB</Set>
    <Set
    
           <Set name="Port"
    >7443<
    >7443</Set>
    <Set
    
           <Set name="maxIdleTime"
    >30000<
    >30000</Set>
    
    <!—- If you will set NeedClientAuth property
    to 
     to true
     
    
    it means you have enabled the client
    authentication 
     authentication for
     
     this
     
     connector i.e.
    client will be
    authenticated 
     authenticated for
     
     the each request
    and 
     and if
     
     you set it
    to 
     to false
     
    
    then it means client will not be authenticated at server side. -->
    <Set
    
            <Set name="NeedClientAuth"
    >true<
    >true</Set>
    <Set
    
            <Set name="Acceptors"
    >2<
    >2</Set>
    <Set
    
            <Set name="AcceptQueueSize"
    >100<
    >100</Set>
    
          </New>
         
    </Item>
  5. Enter the following details within the new SslSelectChannelConnector, which you have added.

    1. Define the name of the sslContextFactory, which you have added.

    2. Enter the name of SslSelectChannelConnector.

    3. Enter the port at which you want to publish the Web Service.

    4. If you want to authenticate the client, set the value of NeedClientAuth attribute to true.

     
    1. Info

      If you want to publish more than one Web Service each on different ports, then you have to

    define 
    1. define SslSelectChannelConnector

     for
    1. for each port.

  6. Save the file and restart the kernel and WebRunner.