You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.371
Former-commit-id: 1cedda3b6a8e480191a7a40a8dc33eb078fba58b
This commit is contained in:
parent
62edeef69b
commit
069517201b
@@ -273,11 +273,13 @@ namespace Mono.Btls
|
||||
|
||||
var cipher = (CipherSuiteCode)ssl.GetCipher ();
|
||||
var protocol = (TlsProtocolCode)ssl.GetVersion ();
|
||||
var serverName = ssl.GetServerName ();
|
||||
Debug ("GET CONNECTION INFO: {0:x}:{0} {1:x}:{1} {2}", cipher, protocol, (TlsProtocolCode)protocol);
|
||||
|
||||
connectionInfo = new MonoTlsConnectionInfo {
|
||||
CipherSuiteCode = cipher,
|
||||
ProtocolVersion = GetProtocol (protocol)
|
||||
ProtocolVersion = GetProtocol (protocol),
|
||||
PeerDomainName = serverName
|
||||
};
|
||||
}
|
||||
|
||||
@@ -361,7 +363,23 @@ namespace Mono.Btls
|
||||
public override void Close ()
|
||||
{
|
||||
Debug ("Close!");
|
||||
ssl.Dispose ();
|
||||
|
||||
if (ssl != null) {
|
||||
ssl.Dispose ();
|
||||
ssl = null;
|
||||
}
|
||||
if (ctx != null) {
|
||||
ctx.Dispose ();
|
||||
ctx = null;
|
||||
}
|
||||
if (bio != null) {
|
||||
bio.Dispose ();
|
||||
bio = null;
|
||||
}
|
||||
if (errbio != null) {
|
||||
errbio.Dispose ();
|
||||
errbio = null;
|
||||
}
|
||||
}
|
||||
|
||||
void Dispose<T> (ref T disposable)
|
||||
|
@@ -124,6 +124,9 @@ namespace Mono.Btls
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static int mono_btls_ssl_set_server_name (IntPtr handle, IntPtr name);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static IntPtr mono_btls_ssl_get_server_name (IntPtr handle);
|
||||
|
||||
static BoringSslHandle Create_internal (MonoBtlsSslCtx ctx)
|
||||
{
|
||||
var handle = mono_btls_ssl_new (ctx.Handle.DangerousGetHandle ());
|
||||
@@ -409,6 +412,16 @@ namespace Mono.Btls
|
||||
}
|
||||
}
|
||||
|
||||
public string GetServerName ()
|
||||
{
|
||||
CheckThrow ();
|
||||
var namePtr = mono_btls_ssl_get_server_name (
|
||||
Handle.DangerousGetHandle ());
|
||||
if (namePtr == IntPtr.Zero)
|
||||
return null;
|
||||
return Marshal.PtrToStringAnsi (namePtr);
|
||||
}
|
||||
|
||||
protected override void Close ()
|
||||
{
|
||||
mono_btls_ssl_close (Handle.DangerousGetHandle ());
|
||||
|
Reference in New Issue
Block a user