tests.connection: add basic encrypted connection tests
Since I went to the effort of getting this to build with LibreSSL, it makes sense to check that it works. And it seems to. There's nothing special about the certificates added, except that they don't expire for 100 years, which is hopefully long enough that nothing will matter any more. They get baked into the test executable, since this was the best way I could figure out to be able to consistently load them during runtime, since they're stored relative to the source, not necessarily relative to the working directory in use when the test executable is run. This required some augmentation to the test server launcher which will make it easier to add additional flags to it in the future, if that becomes necessary.
This commit is contained in:
@@ -60,7 +60,7 @@ pub const AddressPort = struct {
|
||||
};
|
||||
|
||||
pub const Connection = opaque {
|
||||
pub fn create(options: *ConnectionOptions) Error!*Connection {
|
||||
pub fn connect(options: *ConnectionOptions) Error!*Connection {
|
||||
var self: *Connection = undefined;
|
||||
const status = Status.fromInt(nats_c.natsConnection_Connect(@ptrCast(&self), @ptrCast(options)));
|
||||
return status.toError() orelse self;
|
||||
|
Reference in New Issue
Block a user