projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[System]: Correctly implement close and shutdown in SslStream. (#4969)
[mono.git]
/
mcs
/
class
/
System
/
Mono.Net.Security
/
MobileTlsContext.cs
diff --git
a/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
b/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
index f051a5fcbc2c04ca406f2edebcf63019cc0af693..b4ba1c014cabf7cb5e47d7410d46d19e5aa10106 100644
(file)
--- a/
mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
+++ b/
mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
@@
-35,6
+35,7
@@
namespace Mono.Net.Security
MobileAuthenticatedStream parent;
bool serverMode;
string targetHost;
MobileAuthenticatedStream parent;
bool serverMode;
string targetHost;
+ string serverName;
SslProtocols enabledProtocols;
X509Certificate serverCertificate;
X509CertificateCollection clientCertificates;
SslProtocols enabledProtocols;
X509Certificate serverCertificate;
X509CertificateCollection clientCertificates;
@@
-54,6
+55,13
@@
namespace Mono.Net.Security
this.clientCertificates = clientCertificates;
this.askForClientCert = askForClientCert;
this.clientCertificates = clientCertificates;
this.askForClientCert = askForClientCert;
+ serverName = targetHost;
+ if (!string.IsNullOrEmpty (serverName)) {
+ var pos = serverName.IndexOf (':');
+ if (pos > 0)
+ serverName = serverName.Substring (0, pos);
+ }
+
certificateValidator = CertificateValidationHelper.GetInternalValidator (
parent.Settings, parent.Provider);
}
certificateValidator = CertificateValidationHelper.GetInternalValidator (
parent.Settings, parent.Provider);
}
@@
-92,6
+100,10
@@
namespace Mono.Net.Security
get { return targetHost; }
}
get { return targetHost; }
}
+ protected string ServerName {
+ get { return serverName; }
+ }
+
protected bool AskForClientCertificate {
get { return askForClientCert; }
}
protected bool AskForClientCertificate {
get { return askForClientCert; }
}
@@
-157,7
+169,7
@@
namespace Mono.Net.Security
public abstract int Write (byte[] buffer, int offset, int count, out bool wantMore);
public abstract int Write (byte[] buffer, int offset, int count, out bool wantMore);
- public abstract void
Close
();
+ public abstract void
Shutdown
();
protected bool ValidateCertificate (X509Certificate leaf, X509Chain chain)
{
protected bool ValidateCertificate (X509Certificate leaf, X509Chain chain)
{