Permalink
Browse files

#282 removing dependancies on native SSL libarary which was never com…

…pletely working
  • Loading branch information...
1 parent b7fc061 commit a9aeb0d454da81fda4a78f87cc280d38d20f399e @jamesdbloom committed Oct 12, 2016
View
@@ -16,8 +16,6 @@ RUN \
mkdir -p /opt/mockserver && \
wget -O /opt/mockserver/mockserver-netty-jar-with-dependencies.jar https://oss.sonatype.org/content/repositories/releases/org/mock-server/mockserver-netty/3.10.4/mockserver-netty-3.10.4-jar-with-dependencies.jar && \
wget -O /opt/mockserver/run_mockserver.sh https://raw.github.com/jamesdbloom/mockserver/master/docker/run_mockserver.sh && \
- wget -O /opt/mockserver/libtcnative-1.so.0.1.27 https://raw.github.com/jamesdbloom/mockserver/master/docker/libtcnative-1.so.0.1.27 && \
- wget -O /opt/mockserver/tomcat-native-1.1.27.jar https://raw.github.com/jamesdbloom/mockserver/master/docker/tomcat-native-1.1.27.jar && \
wget -O /opt/mockserver/CertificateAuthorityCertificate.pem https://raw.github.com/jamesdbloom/mockserver/master/mockserver-core/src/main/resources/org/mockserver/socket/CertificateAuthorityCertificate.pem && \
chmod +x /opt/mockserver/run_mockserver.sh
@@ -1,29 +0,0 @@
-To rebuild `libtcnative-1.so` and `tomcat-native-1.1.27.jar` use the following steps
-
-```bash
-mkdir native_ssl
-docker run -i -t -v `pwd`/native_ssl:/native_ssl java /bin/bash
-cd /native_ssl
-git clone https://github.com/twitter/finagle.git
-apt-get update
-apt-get install -y build-essential patch libapr1 libapr1-dev openssl libssl-dev ant
-cd finagle/finagle-native/
-./grab_and_patch_tomcat_native.sh
-cd tomcat-native-1.1.27-src/jni/native/
-./configure --with-apr=/usr/bin/apr-1-config --with-java-home=$JAVA_HOME --with-ssl=yes
-make && make install
-cd ..
-ant jar
-cp /usr/local/apr/lib/libtcnative-1.so.0.1.27 /native_ssl/
-cp ./dist/tomcat-native-1.1.27.jar /native_ssl/
-rm -rf /native_ssl/finagle/
-exit
-```
-
-To test use Apache Bench
-
-```bash
-apt-get install apache2 apache2-utils
-curl 'http://172.17.0.2:1080/expectation' -X PUT -H 'Content-Type: application/json' -d '{"httpRequest":{"method":"GET","path":"/simple"},"httpResponse":{"statusCode":200,"body":"some response"},"times":{"remainingTimes":1,"unlimited":true}}'
-ab -n 10000 -c 100 -Z 'AES128-SHA' https://172.17.0.2:1080/simple
-```
Binary file not shown.
@@ -120,4 +120,4 @@ then
MOCKSERVER_HOME="/opt/mockserver"
fi
-runCommand "java -Dfile.encoding=UTF-8 -Dmockserver.logLevel=$LOG_LEVEL -Djava.library.path=$MOCKSERVER_HOME/libtcnative-1.so.0.1.27 -cp $MOCKSERVER_HOME/mockserver-netty-jar-with-dependencies.jar:$MOCKSERVER_HOME/tomcat-native-1.1.27.jar org.mockserver.cli.Main$COMMAND_LINE_OPTS"
+runCommand "java -Dfile.encoding=UTF-8 -Dmockserver.logLevel=$LOG_LEVEL -jar $MOCKSERVER_HOME/mockserver-netty-jar-with-dependencies.jar$COMMAND_LINE_OPTS"
Binary file not shown.
@@ -47,12 +47,6 @@
<artifactId>netty-transport</artifactId>
</dependency>
- <!-- native SSL -->
- <dependency>
- <groupId>com.twitter</groupId>
- <artifactId>finagle-native_2.11</artifactId>
- </dependency>
-
<!-- gzip HTTP deflater & inflater -->
<dependency>
<groupId>com.jcraft</groupId>
@@ -1,6 +1,5 @@
package org.mockserver.server.unification;
-import com.twitter.finagle.ssl.Ssl;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
@@ -10,15 +9,12 @@
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.logging.LoggingHandler;
-import io.netty.handler.ssl.OpenSsl;
import io.netty.handler.ssl.SslHandler;
import io.netty.util.AttributeKey;
import org.mockserver.socket.SSLFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.net.ssl.SSLEngine;
-
/**
* @author jamesdbloom
*/
@@ -82,16 +78,7 @@ private boolean isHttp(ByteBuf msg) {
private void enableSsl(ChannelHandlerContext ctx, ByteBuf msg) {
ChannelPipeline pipeline = ctx.pipeline();
- if (OpenSsl.isAvailable()) {
- SSLEngine engine = Ssl.server(
- "ClientCertificate.pem",
- "ClientPrivateKey.pem",
- "CertificateAuthorityCertificate.pem",
- null, null).self();
- pipeline.addFirst(new SslHandler(engine));
- } else {
- pipeline.addFirst(new SslHandler(SSLFactory.createServerSSLEngine()));
- }
+ pipeline.addFirst(new SslHandler(SSLFactory.createServerSSLEngine()));
ctx.channel().attr(PortUnificationHandler.SSL_ENABLED).set(Boolean.TRUE);
// re-unify (with SSL enabled)
View
@@ -231,13 +231,6 @@
<version>${netty.version}</version>
</dependency>
- <!-- native SSL -->
- <dependency>
- <groupId>com.twitter</groupId>
- <artifactId>finagle-native_2.11</artifactId>
- <version>6.33.0</version>
- </dependency>
-
<!-- gzip HTTP deflater & inflater -->
<dependency>
<groupId>com.jcraft</groupId>

0 comments on commit a9aeb0d

Please sign in to comment.