This is an automated email from the ASF dual-hosted git repository.
ljain pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis-thirdparty.git
The following commit(s) were added to refs/heads/master by this push:
new b75880c RATIS-1546. Add Netty ssl tests to thirdparty. (#30)
b75880c is described below
commit b75880c6e1c50006335bbf1c59e89fa94c41b86e
Author: Tsz-Wo Nicholas Sze <[email protected]>
AuthorDate: Fri Mar 11 14:54:59 2022 +0800
RATIS-1546. Add Netty ssl tests to thirdparty. (#30)
---
.../ratis/thirdparty/demo/grpc/GrpcSslClient.java | 15 +--
.../ratis/thirdparty/demo/grpc/GrpcSslServer.java | 15 +--
.../ratis/thirdparty/demo/netty/NettyClient.java | 112 +++++++++++++++++++++
.../ratis/thirdparty/demo/netty/NettyServer.java | 105 +++++++++++++++++++
.../ratis/thirdparty/demo/netty/NettyUtils.java | 74 ++++++++++++++
.../ratis/thirdparty/demo/netty/NettySslTest.java | 77 ++++++++++++++
test/src/test/resources/ssl/ca.crt | 17 ++++
test/src/test/resources/ssl/ca.key | 17 ++++
test/src/test/resources/ssl/client.crt | 17 ++++
test/src/test/resources/ssl/client.csr | 17 ++++
test/src/test/resources/ssl/client.key | 17 ++++
test/src/test/resources/ssl/client.pem | 17 ++++
test/src/test/resources/ssl/server.crt | 17 ++++
test/src/test/resources/ssl/server.csr | 17 ++++
test/src/test/resources/ssl/server.key | 17 ++++
test/src/test/resources/ssl/server.pem | 17 ++++
16 files changed, 542 insertions(+), 26 deletions(-)
diff --git
a/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslClient.java
b/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslClient.java
index 139722c..2409bd5 100644
---
a/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslClient.java
+++
b/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslClient.java
@@ -17,6 +17,7 @@
*/
package org.apache.ratis.thirdparty.demo.grpc;
+import org.apache.ratis.thirdparty.demo.netty.NettyUtils;
import org.apache.ratis.thirdparty.demo.proto.GreeterGrpc;
import org.apache.ratis.thirdparty.demo.proto.HelloReply;
import org.apache.ratis.thirdparty.demo.proto.HelloRequest;
@@ -27,7 +28,6 @@ import
org.apache.ratis.thirdparty.io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
-import org.apache.ratis.thirdparty.io.grpc.netty.GrpcSslContexts;
import org.apache.ratis.thirdparty.io.grpc.netty.NettyChannelBuilder;
import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContextBuilder;
import org.slf4j.Logger;
@@ -53,18 +53,7 @@ public class GrpcSslClient {
// Hacky way to work around hostname verify of the certificate
//channelBuilder.overrideAuthority(
// InetAddress.getLocalHost().getHostName()) ;
- SslContextBuilder sslContextBuilder = GrpcSslContexts.forClient();
- if (conf.getTrustCertCollection() != null) {
- sslContextBuilder.trustManager(conf.getTrustCertCollection());
- }
- if (conf.isMutualAuthn()) {
- sslContextBuilder.keyManager(conf.getCertChain(), conf.getPrivateKey());
- }
- if (conf.encryptionEnabled()) {
- sslContextBuilder.ciphers(conf.getTlsCipherSuitesWithEncryption());
- } else {
- sslContextBuilder.ciphers(conf.getTlsCipherSuitesNoEncryption());
- }
+ SslContextBuilder sslContextBuilder =
NettyUtils.newClientSslContextBuilder(conf);
return channelBuilder.useTransportSecurity()
.sslContext(sslContextBuilder.build()).build();
}
diff --git
a/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslServer.java
b/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslServer.java
index 21ae8ea..addd9f9 100644
---
a/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslServer.java
+++
b/test/src/main/java/org/apache/ratis/thirdparty/demo/grpc/GrpcSslServer.java
@@ -18,10 +18,10 @@
package org.apache.ratis.thirdparty.demo.grpc;
import org.apache.ratis.thirdparty.demo.common.SslServerConfig;
+import org.apache.ratis.thirdparty.demo.netty.NettyUtils;
import org.apache.ratis.thirdparty.io.grpc.Server;
import org.apache.ratis.thirdparty.io.grpc.netty.GrpcSslContexts;
import org.apache.ratis.thirdparty.io.grpc.netty.NettyServerBuilder;
-import org.apache.ratis.thirdparty.io.netty.handler.ssl.ClientAuth;
import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContextBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,20 +48,9 @@ public class GrpcSslServer {
void start() throws IOException {
NettyServerBuilder nettyServerBuilder =
NettyServerBuilder.forPort(port).addService(new GreeterImpl());
- SslContextBuilder sslContextBuilder = SslContextBuilder.forServer(
- conf.getServerCertChain(), conf.getPrivateKey());
- if (conf.isMutualAuthn()) {
- sslContextBuilder.clientAuth(ClientAuth.REQUIRE);
- sslContextBuilder.trustManager(conf.getClientCertChain());
- }
+ SslContextBuilder sslContextBuilder =
NettyUtils.newServerSslContextBuilder(conf);
sslContextBuilder =
GrpcSslContexts.configure(sslContextBuilder, OPENSSL);
- if (conf.encryptionEnabled()) {
- sslContextBuilder.ciphers(conf.getTlsCipherSuitesWithEncryption());
- } else {
- sslContextBuilder.ciphers(conf.getTlsCipherSuitesNoEncryption());
- }
-
nettyServerBuilder.sslContext(sslContextBuilder.build());
server = nettyServerBuilder.build().start();
diff --git
a/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyClient.java
b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyClient.java
new file mode 100644
index 0000000..4be14be
--- /dev/null
+++ b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyClient.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ratis.thirdparty.demo.netty;
+
+import org.apache.ratis.thirdparty.io.netty.bootstrap.Bootstrap;
+import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelFuture;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelHandlerContext;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelInboundHandler;
+import
org.apache.ratis.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelInitializer;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelOption;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelPipeline;
+import org.apache.ratis.thirdparty.io.netty.channel.EventLoopGroup;
+import org.apache.ratis.thirdparty.io.netty.channel.nio.NioEventLoopGroup;
+import org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel;
+import
org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioSocketChannel;
+import org.apache.ratis.thirdparty.io.netty.handler.logging.LogLevel;
+import org.apache.ratis.thirdparty.io.netty.handler.logging.LoggingHandler;
+import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Closeable;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Netty demo server with shaded ratis thirdparty jar.
+ */
+public class NettyClient implements Closeable {
+ private static final Logger LOG = LoggerFactory.getLogger(NettyClient.class);
+
+ private final EventLoopGroup workerGroup = new NioEventLoopGroup(3);
+ private final ChannelFuture channelFuture;
+
+
+ private final Queue<CompletableFuture<String>> queue = new LinkedList<>();
+
+ public NettyClient(String host, int port, SslContext sslContext) {
+ this.channelFuture = new Bootstrap()
+ .group(workerGroup)
+ .channel(NioSocketChannel.class)
+ .handler(new LoggingHandler(getClass(), LogLevel.INFO))
+ .handler(newChannelInitializer(sslContext))
+ .option(ChannelOption.SO_KEEPALIVE, true)
+ .option(ChannelOption.TCP_NODELAY, true)
+ .connect(host, port)
+ .syncUninterruptibly();
+ }
+
+ public CompletableFuture<String> writeAndFlush(ByteBuf buf) {
+ final CompletableFuture<String> reply = new CompletableFuture<>();
+ queue.offer(reply);
+ channelFuture.channel().writeAndFlush(buf);
+ return reply;
+ }
+
+ private ChannelInitializer<SocketChannel> newChannelInitializer(SslContext
sslContext){
+ return new ChannelInitializer<SocketChannel>(){
+ @Override
+ public void initChannel(SocketChannel ch) {
+ ChannelPipeline p = ch.pipeline();
+ if (sslContext != null) {
+ p.addLast("ssl", sslContext.newHandler(ch.alloc()));
+ }
+ p.addLast(getClientHandler());
+ }
+ };
+ }
+
+ private ChannelInboundHandler getClientHandler(){
+ return new ChannelInboundHandlerAdapter(){
+ @Override
+ public void channelRead(ChannelHandlerContext ctx, Object obj) {
+ final String s = NettyUtils.buffer2String((ByteBuf) obj);
+ LOG.info("received: " + s);
+ for(String word : s.split(" ")) {
+ queue.remove().complete(word);
+ }
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+ LOG.error(NettyClient.this.getClass().getSimpleName() + ":
exceptionCaught", cause);
+ ctx.close();
+ }
+ };
+ }
+
+ @Override
+ public void close() {
+ channelFuture.channel().close();
+ workerGroup.shutdownGracefully();
+ }
+}
\ No newline at end of file
diff --git
a/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyServer.java
b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyServer.java
new file mode 100644
index 0000000..f2c44e5
--- /dev/null
+++ b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyServer.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ratis.thirdparty.demo.netty;
+
+import org.apache.ratis.thirdparty.io.netty.bootstrap.ServerBootstrap;
+import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelFuture;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelHandlerContext;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelInboundHandler;
+import
org.apache.ratis.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelInitializer;
+import org.apache.ratis.thirdparty.io.netty.channel.ChannelPipeline;
+import org.apache.ratis.thirdparty.io.netty.channel.EventLoopGroup;
+import org.apache.ratis.thirdparty.io.netty.channel.nio.NioEventLoopGroup;
+import org.apache.ratis.thirdparty.io.netty.channel.socket.SocketChannel;
+import
org.apache.ratis.thirdparty.io.netty.channel.socket.nio.NioServerSocketChannel;
+import org.apache.ratis.thirdparty.io.netty.handler.logging.LogLevel;
+import org.apache.ratis.thirdparty.io.netty.handler.logging.LoggingHandler;
+import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Closeable;
+
+/**
+ * Netty demo server with shaded ratis thirdparty jar.
+ */
+public class NettyServer implements Closeable {
+ private static final Logger LOG = LoggerFactory.getLogger(NettyServer.class);
+
+ private final EventLoopGroup bossGroup = new NioEventLoopGroup(3);
+ private final EventLoopGroup workerGroup = new NioEventLoopGroup(3);
+ private final ChannelFuture channelFuture;
+
+ public NettyServer(int port, SslContext sslContext) {
+ this.channelFuture = new ServerBootstrap()
+ .group(bossGroup, workerGroup)
+ .channel(NioServerSocketChannel.class)
+ .handler(new LoggingHandler(getClass(), LogLevel.INFO))
+ .childHandler(newChannelInitializer(sslContext))
+ .bind(port)
+ .syncUninterruptibly();
+ }
+
+ private ChannelInitializer<SocketChannel> newChannelInitializer(SslContext
sslContext){
+ return new ChannelInitializer<SocketChannel>(){
+ @Override
+ public void initChannel(SocketChannel ch) {
+ final ChannelPipeline p = ch.pipeline();
+ if (sslContext != null) {
+ p.addLast("ssl", sslContext.newHandler(ch.alloc()));
+ }
+ p.addLast(newServerHandler());
+ }
+ };
+ }
+
+ private ChannelInboundHandler newServerHandler(){
+ return new ChannelInboundHandlerAdapter() {
+ @Override
+ public void channelRead(ChannelHandlerContext ctx, Object obj) {
+ if (obj instanceof ByteBuf) {
+ final String s = NettyUtils.buffer2String((ByteBuf) obj);
+ LOG.info("channelRead: " + s);
+ for(String word : s.split(" ")) {
+ ctx.writeAndFlush(NettyUtils.unpooledBuffer(toReply(word) + " "));
+ }
+ }
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable
throwable) {
+ LOG.error(NettyServer.this.getClass().getSimpleName() + ":
exceptionCaught", throwable);
+ ctx.close();
+ }
+ };
+ }
+
+ static String toReply(String request) {
+ return "[" + request + "]";
+ }
+
+
+ @Override
+ public void close() {
+ channelFuture.channel().close();
+ bossGroup.shutdownGracefully();
+ workerGroup.shutdownGracefully();
+ }
+}
\ No newline at end of file
diff --git
a/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyUtils.java
b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyUtils.java
new file mode 100644
index 0000000..302fb54
--- /dev/null
+++ b/test/src/main/java/org/apache/ratis/thirdparty/demo/netty/NettyUtils.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ratis.thirdparty.demo.netty;
+
+import org.apache.ratis.thirdparty.demo.common.SslClientConfig;
+import org.apache.ratis.thirdparty.demo.common.SslServerConfig;
+import org.apache.ratis.thirdparty.io.grpc.netty.GrpcSslContexts;
+import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
+import org.apache.ratis.thirdparty.io.netty.buffer.Unpooled;
+import org.apache.ratis.thirdparty.io.netty.handler.ssl.ClientAuth;
+import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContextBuilder;
+
+import java.nio.charset.StandardCharsets;
+
+public interface NettyUtils {
+ static ByteBuf unpooledBuffer(String s) {
+ final ByteBuf buf = Unpooled.buffer();
+ buf.writeBytes(s.getBytes(StandardCharsets.UTF_8));
+ return buf;
+ }
+
+ static String buffer2String(ByteBuf buf){
+ try {
+ return buf.toString(StandardCharsets.UTF_8);
+ } finally {
+ buf.release();
+ }
+ }
+
+ static SslContextBuilder newServerSslContextBuilder(SslServerConfig conf) {
+ final SslContextBuilder b =
SslContextBuilder.forServer(conf.getServerCertChain(), conf.getPrivateKey());
+ if (conf.isMutualAuthn()) {
+ b.clientAuth(ClientAuth.REQUIRE);
+ b.trustManager(conf.getClientCertChain());
+ }
+ if (conf.encryptionEnabled()) {
+ b.ciphers(conf.getTlsCipherSuitesWithEncryption());
+ } else {
+ b.ciphers(conf.getTlsCipherSuitesNoEncryption());
+ }
+ return b;
+ }
+
+ static SslContextBuilder newClientSslContextBuilder(SslClientConfig conf) {
+ final SslContextBuilder b = GrpcSslContexts.forClient();
+ if (conf.getTrustCertCollection() != null) {
+ b.trustManager(conf.getTrustCertCollection());
+ }
+ if (conf.isMutualAuthn()) {
+ b.keyManager(conf.getCertChain(), conf.getPrivateKey());
+ }
+ if (conf.encryptionEnabled()) {
+ b.ciphers(conf.getTlsCipherSuitesWithEncryption());
+ } else {
+ b.ciphers(conf.getTlsCipherSuitesNoEncryption());
+ }
+ return b;
+ }
+}
\ No newline at end of file
diff --git
a/test/src/test/java/org/apache/ratis/thirdparty/demo/netty/NettySslTest.java
b/test/src/test/java/org/apache/ratis/thirdparty/demo/netty/NettySslTest.java
new file mode 100644
index 0000000..3459b81
--- /dev/null
+++
b/test/src/test/java/org/apache/ratis/thirdparty/demo/netty/NettySslTest.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ratis.thirdparty.demo.netty;
+
+import org.apache.ratis.thirdparty.demo.common.SslClientConfig;
+import org.apache.ratis.thirdparty.demo.common.SslServerConfig;
+import org.apache.ratis.thirdparty.demo.common.TestUtils;
+import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
+import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContext;
+import org.junit.Assert;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Unit test for demo netty client/server with ratis thirdparty.
+ */
+public class NettySslTest {
+ private final static Logger LOG =
LoggerFactory.getLogger(NettySslTest.class);
+
+ @Test
+ public void testNoSsl() throws Exception {
+ testNetty(TestUtils.randomPort(), null, null);
+ }
+
+ @Test
+ public void testSsl() throws Exception {
+ testNetty(TestUtils.randomPort(),
+ TestUtils.newSslServerConfig(true, false),
+ TestUtils.newSslClientConfig(true, false));
+ }
+
+ static void testNetty(int port, SslServerConfig serverSslConf,
SslClientConfig clientSslConf) throws Exception {
+ final SslContext serverSslContext = serverSslConf == null? null
+ : NettyUtils.newServerSslContextBuilder(serverSslConf).build();
+ final SslContext clientSslContext = clientSslConf == null? null
+ : NettyUtils.newClientSslContextBuilder(clientSslConf).build();
+
+ final String message = "Hey, how are you?";
+ final String[] words = message.split(" ");
+ try (NettyServer server = new NettyServer(port, serverSslContext);
+ NettyClient client = new NettyClient("localhost", port,
clientSslContext)) {
+ final List<CompletableFuture<String>> replyFutures = new ArrayList<>();
+ for(String word : words) {
+ final ByteBuf buf = NettyUtils.unpooledBuffer(word + " ");
+ final CompletableFuture<String> f = client.writeAndFlush(buf);
+ replyFutures.add(f);
+ }
+ for(int i = 0; i < replyFutures.size(); i++) {
+ final CompletableFuture<String> future = replyFutures.get(i);
+ final String reply = future.get(3, TimeUnit.SECONDS);
+ LOG.info(reply);
+ Assert.assertEquals(NettyServer.toReply(words[i]), reply);
+ }
+ }
+ }
+}
diff --git a/test/src/test/resources/ssl/ca.crt
b/test/src/test/resources/ssl/ca.crt
index cc05e72..4e0519c 100644
--- a/test/src/test/resources/ssl/ca.crt
+++ b/test/src/test/resources/ssl/ca.crt
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN CERTIFICATE-----
MIIFCTCCAvGgAwIBAgIUIVxtEYUqKP75yGl4BFak/NlORQEwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDYwNDEzMDgzM1oXDTMxMDYw
diff --git a/test/src/test/resources/ssl/ca.key
b/test/src/test/resources/ssl/ca.key
index a7acd45..3481897 100644
--- a/test/src/test/resources/ssl/ca.key
+++ b/test/src/test/resources/ssl/ca.key
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,F9550AC98392E96B
diff --git a/test/src/test/resources/ssl/client.crt
b/test/src/test/resources/ssl/client.crt
index 26617c3..7081283 100644
--- a/test/src/test/resources/ssl/client.crt
+++ b/test/src/test/resources/ssl/client.crt
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN CERTIFICATE-----
MIIEnDCCAoQCAQEwDQYJKoZIhvcNAQELBQAwFDESMBAGA1UEAwwJbG9jYWxob3N0
MB4XDTIxMDYwNDEzMDgzM1oXDTMxMDYwMjEzMDgzM1owFDESMBAGA1UEAwwJbG9j
diff --git a/test/src/test/resources/ssl/client.csr
b/test/src/test/resources/ssl/client.csr
index db769f7..e4ed6cd 100644
--- a/test/src/test/resources/ssl/client.csr
+++ b/test/src/test/resources/ssl/client.csr
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN CERTIFICATE REQUEST-----
MIIEWTCCAkECAQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEA066Z8xTn9sX2BqMv+jVD302CeOFyJPH5disAx+f5
diff --git a/test/src/test/resources/ssl/client.key
b/test/src/test/resources/ssl/client.key
index b7c6872..8a5a158 100644
--- a/test/src/test/resources/ssl/client.key
+++ b/test/src/test/resources/ssl/client.key
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN RSA PRIVATE KEY-----
MIIJKgIBAAKCAgEA066Z8xTn9sX2BqMv+jVD302CeOFyJPH5disAx+f5K73rhSSa
q0itTXExR6w2vhI+Zj6hLIq+jjpgxWK7Ki9hvpkvnQdKT7CqllDHL//9PvEe75MZ
diff --git a/test/src/test/resources/ssl/client.pem
b/test/src/test/resources/ssl/client.pem
index 46b475e..a833dde 100644
--- a/test/src/test/resources/ssl/client.pem
+++ b/test/src/test/resources/ssl/client.pem
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN PRIVATE KEY-----
MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDTrpnzFOf2xfYG
oy/6NUPfTYJ44XIk8fl2KwDH5/krveuFJJqrSK1NcTFHrDa+Ej5mPqEsir6OOmDF
diff --git a/test/src/test/resources/ssl/server.crt
b/test/src/test/resources/ssl/server.crt
index 46c2085..aa43f66 100644
--- a/test/src/test/resources/ssl/server.crt
+++ b/test/src/test/resources/ssl/server.crt
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN CERTIFICATE-----
MIIEnDCCAoQCAQEwDQYJKoZIhvcNAQELBQAwFDESMBAGA1UEAwwJbG9jYWxob3N0
MB4XDTIxMDYwNDEzMDgzM1oXDTMxMDYwMjEzMDgzM1owFDESMBAGA1UEAwwJbG9j
diff --git a/test/src/test/resources/ssl/server.csr
b/test/src/test/resources/ssl/server.csr
index 6a03c96..e7daafb 100644
--- a/test/src/test/resources/ssl/server.csr
+++ b/test/src/test/resources/ssl/server.csr
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN CERTIFICATE REQUEST-----
MIIEWTCCAkECAQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAuceyZa7AKmiqYof4KcEb84MOu+zPmujOpBRLH74B
diff --git a/test/src/test/resources/ssl/server.key
b/test/src/test/resources/ssl/server.key
index 6d7b95f..6fed777 100644
--- a/test/src/test/resources/ssl/server.key
+++ b/test/src/test/resources/ssl/server.key
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAuceyZa7AKmiqYof4KcEb84MOu+zPmujOpBRLH74Bc0z05hC0
pCLMMVLkEGAkrVBoBHLfeuhoRdr+hKVdnPaNUv5uW2qpyuFU4DG43wEXKYeQTleu
diff --git a/test/src/test/resources/ssl/server.pem
b/test/src/test/resources/ssl/server.pem
index c8202e6..7a20975 100644
--- a/test/src/test/resources/ssl/server.pem
+++ b/test/src/test/resources/ssl/server.pem
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC5x7JlrsAqaKpi
h/gpwRvzgw677M+a6M6kFEsfvgFzTPTmELSkIswxUuQQYCStUGgEct966GhF2v6E