summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-10-04 19:19:25 +0200
committerBenoit Foucher <benoit@zeroc.com>2019-10-04 19:20:23 +0200
commitab0f8e40f55a68320e637659a775d28666f3b3c7 (patch)
treeca9879eeab93d272425d393991de555e3467b29d
parentFix IceSSL/configuration failures on rhel8 - Close #573 (diff)
downloadice-ab0f8e40f55a68320e637659a775d28666f3b3c7.tar.bz2
ice-ab0f8e40f55a68320e637659a775d28666f3b3c7.tar.xz
ice-ab0f8e40f55a68320e637659a775d28666f3b3c7.zip
Fixed C# IceSSL bug where IOException wasn't catch, fixes #553
-rw-r--r--csharp/src/IceSSL/TransceiverI.cs22
1 files changed, 18 insertions, 4 deletions
diff --git a/csharp/src/IceSSL/TransceiverI.cs b/csharp/src/IceSSL/TransceiverI.cs
index f744ad3a035..1b33620948b 100644
--- a/csharp/src/IceSSL/TransceiverI.cs
+++ b/csharp/src/IceSSL/TransceiverI.cs
@@ -47,10 +47,24 @@ namespace IceSSL
if(_sslStream == null)
{
- _sslStream = new SslStream(new NetworkStream(_delegate.fd(), false),
- false,
- new RemoteCertificateValidationCallback(validationCallback),
- new LocalCertificateSelectionCallback(selectCertificate));
+ try
+ {
+ _sslStream = new SslStream(new NetworkStream(_delegate.fd(), false),
+ false,
+ new RemoteCertificateValidationCallback(validationCallback),
+ new LocalCertificateSelectionCallback(selectCertificate));
+ }
+ catch(IOException ex)
+ {
+ if(IceInternal.Network.connectionLost(ex))
+ {
+ throw new Ice.ConnectionLostException(ex);
+ }
+ else
+ {
+ throw new Ice.SocketException(ex);
+ }
+ }
return IceInternal.SocketOperation.Connect;
}