You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2013/06/14 10:21:24 UTC
svn commit: r865634 - in /websites/production/camel/content:
book-component-appendix.html book-in-one-page.html cache/main.pageCache
netty.html
Author: buildbot
Date: Fri Jun 14 08:21:23 2013
New Revision: 865634
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/netty.html
Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Jun 14 08:21:23 2013
@@ -12590,6 +12590,23 @@ context.addRoutes(<span class="code-keyw
</pre>
</div></div>
+<h5><a shape="rect" name="BookComponentAppendix-GettingaccesstoSSLSessionandtheclientcertificate"></a>Getting access to SSLSession and the client certificate</h5>
+<p><b>Available as of Camel 2.12</b></p>
+
+<p>You can get access to the <tt>javax.net.ssl.SSLSession</tt> if you eg need to get details about the client certificate. When <tt>ssl=true</tt> then the <a shape="rect" href="netty.html" title="Netty">Netty</a> component will store the <tt>SSLSession</tt> as a header on the Camel <a shape="rect" href="message.html" title="Message">Message</a> as shown below:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+SSLSession session = exchange.getIn().getHeader(NettyConstants.NETTY_SSL_SESSION, SSLSession.class);
+<span class="code-comment">// get the first certificate which is client certificate
+</span>javax.security.cert.X509Certificate cert = session.getPeerCertificateChain()[0];
+Principal principal = cert.getSubjectDN();
+</pre>
+</div></div>
+
+<p>Remember to set <tt>needClientAuth=true</tt> to authenticate the client, otherwise <tt>SSLSession</tt> cannot access information about the client certificate, and you may get an exception <tt>javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated</tt>. You may also get this exception if the client certificate is expired or not valid etc.</p>
+
+
<h4><a shape="rect" name="BookComponentAppendix-UsingMultipleCodecs"></a>Using Multiple Codecs</h4>
<p>In certain cases it may be necessary to add chains of encoders and decoders to the netty pipeline. To add multpile codecs to a camel netty endpoint the 'encoders' and 'decoders' uri parameters should be used. Like the 'encoder' and 'decoder' parameters they are used to supply references (to lists of ChannelUpstreamHandlers and ChannelDownstreamHandlers) that should be added to the pipeline. Note that if encoders is specified then the encoder param will be ignored, similarly for decoders and the decoder param.</p>
Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Fri Jun 14 08:21:23 2013
@@ -33667,6 +33667,23 @@ context.addRoutes(<span class="code-keyw
</pre>
</div></div>
+<h5><a shape="rect" name="BookInOnePage-GettingaccesstoSSLSessionandtheclientcertificate"></a>Getting access to SSLSession and the client certificate</h5>
+<p><b>Available as of Camel 2.12</b></p>
+
+<p>You can get access to the <tt>javax.net.ssl.SSLSession</tt> if you eg need to get details about the client certificate. When <tt>ssl=true</tt> then the <a shape="rect" href="netty.html" title="Netty">Netty</a> component will store the <tt>SSLSession</tt> as a header on the Camel <a shape="rect" href="message.html" title="Message">Message</a> as shown below:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+SSLSession session = exchange.getIn().getHeader(NettyConstants.NETTY_SSL_SESSION, SSLSession.class);
+<span class="code-comment">// get the first certificate which is client certificate
+</span>javax.security.cert.X509Certificate cert = session.getPeerCertificateChain()[0];
+Principal principal = cert.getSubjectDN();
+</pre>
+</div></div>
+
+<p>Remember to set <tt>needClientAuth=true</tt> to authenticate the client, otherwise <tt>SSLSession</tt> cannot access information about the client certificate, and you may get an exception <tt>javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated</tt>. You may also get this exception if the client certificate is expired or not valid etc.</p>
+
+
<h4><a shape="rect" name="BookInOnePage-UsingMultipleCodecs"></a>Using Multiple Codecs</h4>
<p>In certain cases it may be necessary to add chains of encoders and decoders to the netty pipeline. To add multpile codecs to a camel netty endpoint the 'encoders' and 'decoders' uri parameters should be used. Like the 'encoder' and 'decoder' parameters they are used to supply references (to lists of ChannelUpstreamHandlers and ChannelDownstreamHandlers) that should be added to the pipeline. Note that if encoders is specified then the encoder param will be ignored, similarly for decoders and the decoder param.</p>
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/netty.html
==============================================================================
--- websites/production/camel/content/netty.html (original)
+++ websites/production/camel/content/netty.html Fri Jun 14 08:21:23 2013
@@ -261,6 +261,23 @@ context.addRoutes(<span class="code-keyw
</pre>
</div></div>
+<h5><a shape="rect" name="Netty-GettingaccesstoSSLSessionandtheclientcertificate"></a>Getting access to SSLSession and the client certificate</h5>
+<p><b>Available as of Camel 2.12</b></p>
+
+<p>You can get access to the <tt>javax.net.ssl.SSLSession</tt> if you eg need to get details about the client certificate. When <tt>ssl=true</tt> then the <a shape="rect" href="netty.html" title="Netty">Netty</a> component will store the <tt>SSLSession</tt> as a header on the Camel <a shape="rect" href="message.html" title="Message">Message</a> as shown below:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+SSLSession session = exchange.getIn().getHeader(NettyConstants.NETTY_SSL_SESSION, SSLSession.class);
+<span class="code-comment">// get the first certificate which is client certificate
+</span>javax.security.cert.X509Certificate cert = session.getPeerCertificateChain()[0];
+Principal principal = cert.getSubjectDN();
+</pre>
+</div></div>
+
+<p>Remember to set <tt>needClientAuth=true</tt> to authenticate the client, otherwise <tt>SSLSession</tt> cannot access information about the client certificate, and you may get an exception <tt>javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated</tt>. You may also get this exception if the client certificate is expired or not valid etc.</p>
+
+
<h4><a shape="rect" name="Netty-UsingMultipleCodecs"></a>Using Multiple Codecs</h4>
<p>In certain cases it may be necessary to add chains of encoders and decoders to the netty pipeline. To add multpile codecs to a camel netty endpoint the 'encoders' and 'decoders' uri parameters should be used. Like the 'encoder' and 'decoder' parameters they are used to supply references (to lists of ChannelUpstreamHandlers and ChannelDownstreamHandlers) that should be added to the pipeline. Note that if encoders is specified then the encoder param will be ignored, similarly for decoders and the decoder param.</p>