Closed Viktorstst closed 3 years ago
It is not accessible currently. Which SSL setting(s) do you need to control?
CheckCertificateRevocation and ClientCertificates from SSL settings and Timeout(send/receive) from TCP settings.
It can be done. However, the SSL and TCP settings are part of the ConnectionFactory
API which is not available to net35. One option is the enhance the IHandler interface with two events: SocketConnected and SslNegotiation, where user can configure the socket or SslStream settings.
Socket and SslStream are exposed through new handler events. To set socket properties or perform custom SslStream authentication, do something as follows.
var handler = new TestHandler(e =>
{
if (e.Id == EventId.SocketConnect)
{
((System.Net.Sockets.Socket)e.Context).SendBufferSize = 4096;
}
else if (e.Id == EventId.SslAuthenticate)
{
((System.Net.Security.SslStream)e.Context).AuthenticateAsClient("localhost");
}
});
Address sslAddress = new Address("amqps://guest:guest@localhost:5671");
Connection connection = new Connection(sslAddress, handler);
Is there a way to access connection SSL settings under .NET 3.5?