Module vibe.stream.ssl

SSL/TLS stream implementation

SSLStream can be used to implement SSL/TLS communication on top of a TCP connection. The initial SSLStreamState determines if the SSL tunnel is on the client or server side.

Examples

A simple SSL client:

void sendSSLMessage()
{
	auto conn = connectTCP("127.0.0.1", 1234);
	auto sslctx = mew SSLContext;
	auto stream = new SSLStream(conn, sslctx, SSLStreamState.connecting);
	stream.write("Hello, World!");
	stream.finalize();
	conn.close();
}

Corresponding server:

void listenForSSL()
{
	auto sslctx = new SSLContext("server.crt", "server.key");
	listenTCP(1234, (conn){
		auto stream = new SSLStream(conn, sslctx, SSLStreamState.accepting);
		logInfo("Got message: %s", strea.readAllUtf8());
		stream.finalize();
	});
}

Classes

Name Description
SSLContext
SSLStream Creates an SSL/TLS tunnel within an existing stream.

Enums

Name Description
SSLStreamState
SSLVersion

Aliases

Name Type Description
SslContext SSLContext Deprecated compatibility alias
SslStream SSLStream Deprecated compatibility alias
SslStreamState SSLStreamState Deprecated compatibility alias

Authors

Sönke Ludwig

Copyright

© 2012 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.