-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provides rollback to CompositeByteBuf usage (#750)
* provides rollback to CompositeByteBuf usage Signed-off-by: Oleh Dokuka <shadowgun@i.ua> * fixes test Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
- Loading branch information
1 parent
2f71f73
commit 0cc46d0
Showing
7 changed files
with
138 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
55 changes: 55 additions & 0 deletions
55
rsocket-transport-netty/src/test/java/io/rsocket/transport/netty/TcpSecureTransportTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.rsocket.transport.netty; | ||
|
||
import io.netty.handler.ssl.SslContextBuilder; | ||
import io.netty.handler.ssl.util.InsecureTrustManagerFactory; | ||
import io.netty.handler.ssl.util.SelfSignedCertificate; | ||
import io.rsocket.test.TransportTest; | ||
import io.rsocket.transport.netty.client.TcpClientTransport; | ||
import io.rsocket.transport.netty.server.TcpServerTransport; | ||
import java.net.InetSocketAddress; | ||
import java.security.cert.CertificateException; | ||
import java.time.Duration; | ||
import reactor.core.Exceptions; | ||
import reactor.netty.tcp.TcpClient; | ||
import reactor.netty.tcp.TcpServer; | ||
|
||
public class TcpSecureTransportTest implements TransportTest { | ||
private final TransportPair transportPair = | ||
new TransportPair<>( | ||
() -> new InetSocketAddress("localhost", 0), | ||
(address, server) -> | ||
TcpClientTransport.create( | ||
TcpClient.create() | ||
.addressSupplier(server::address) | ||
.secure( | ||
ssl -> | ||
ssl.sslContext( | ||
SslContextBuilder.forClient() | ||
.trustManager(InsecureTrustManagerFactory.INSTANCE)))), | ||
address -> { | ||
try { | ||
SelfSignedCertificate ssc = new SelfSignedCertificate(); | ||
TcpServer server = | ||
TcpServer.create() | ||
.addressSupplier(() -> address) | ||
.secure( | ||
ssl -> | ||
ssl.sslContext( | ||
SslContextBuilder.forServer( | ||
ssc.certificate(), ssc.privateKey()))); | ||
return TcpServerTransport.create(server); | ||
} catch (CertificateException e) { | ||
throw Exceptions.propagate(e); | ||
} | ||
}); | ||
|
||
@Override | ||
public Duration getTimeout() { | ||
return Duration.ofMinutes(10); | ||
} | ||
|
||
@Override | ||
public TransportPair getTransportPair() { | ||
return transportPair; | ||
} | ||
} |