This section explains how to add SSL SelectChannelSelector in Adeptia Jetty.
...
- Go to /ServerKernel/etc/jetty folder and open the Jetty.xml file.
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" |
/>/etc/jetty/custom.keystore</Set> |
<Set
name="KeyStorePassword">password</Set> |
<Set
name="KeyManagerPassword">password</Set> |
<Set name="TrustStore"><Property
name="jetty.home" |
/>/etc/jetty/custom1.keystore</Set> |
<Set
name="TrustStorePassword">password</Set> |
- Define the following details within the new sslContextFactory, which you have defined:
- Path and Name of the keystore file.
- Keystore password
- Key Manager password
- Path and Name of the truststore.
- Truststore password
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" |
<Set
<Set name="name">HttpsConnectorB</Set> |
<Set >
7443
<<Set >
30000
<
<!—- If you will set NeedClientAuth property |
to
it means you have enabled the client |
authentication connector i.e.
client will be |
authenticated and to
then it means client will not be authenticated at server side. --> |
<Set
<Set name="NeedClientAuth" |
>
true
<<Set >
2
<<Set
<Set name="AcceptQueueSize" |
>
100
<Enter the following details within the new SslSelectChannelConnector, which you have added.
Define the name of the sslContextFactory, which you have added.
Enter the name of SslSelectChannelConnector.
Enter the port at which you want to publish the Web Service.
If you want to authenticate the client, set the value of NeedClientAuth attribute to true.
Info |
---|
If you want to publish more than one Web Service each on different ports, then you have to |
define define SslSelectChannelConnector |
for
Save the file and restart the kernel and WebRunner.