public SecureChannel(ConnectionEnd connectionEnd) { m_handshakeLayer = new HandshakeLayer(this, connectionEnd); m_handshakeLayer.CipherSuiteChange += OnCipherSuiteChangeFromHandshakeLayer; m_recordLayer = new RecordLayer(m_protocolVersion); m_outgoingMessageBag = new OutgoingMessageBag(this); }
/// <summary> /// Create a new SecureChannel with the given <see cref="ConnectionEnd"/>. /// </summary> /// <param name="connectionEnd">the ConnectionEnd that this channel is to talk to</param> public SecureChannel(ConnectionEnd connectionEnd) { m_handshakeLayer = new HandshakeLayer(this, connectionEnd); m_handshakeLayer.CipherSuiteChange += OnCipherSuiteChangeFromHandshakeLayer; m_recordLayer = new RecordLayer(m_protocolVersion); m_outgoingMessageBag = new OutgoingMessageBag(this); }
public void Dispose() { if (m_handshakeLayer != null) { m_handshakeLayer.Dispose(); m_handshakeLayer = null; } if (m_recordLayer != null) { m_recordLayer.Dispose(); m_recordLayer = null; } }
/// <summary> /// Create a new SecureChannel with the given <see cref="ConnectionEnd"/>. /// </summary> /// <param name="connectionEnd">the ConnectionEnd that this channel is to talk to</param> private SecureChannel(ConnectionEnd connectionEnd, Configuration configuration = null) { Configuration = configuration ?? new Configuration(); n_ConnectionEnd = connectionEnd; m_handshakeLayer = new HandshakeLayer(this, connectionEnd); m_handshakeLayer.CipherSuiteChange += OnCipherSuiteChangeFromHandshakeLayer; RecordLayer = new RecordLayer(); m_outgoingMessageBag = new OutgoingMessageBag(this); if (!Configuration.VerifyCertificate) { //若不验证证书,则直接返回true SetVerifyCertificate(c => true); } }
/// <summary> /// Release any contained resources of this SecureChannel object. /// </summary> /// <param name="disposing">set this to true if disposing of managed resources</param> /// <remarks> /// This disposes of the handshake-layer and the record-layer. /// </remarks> protected virtual void Dispose(bool disposing) { if (!disposing) { return; } if (m_handshakeLayer != null) { m_handshakeLayer.Dispose(); m_handshakeLayer = null; } if (m_recordLayer != null) { m_recordLayer.Dispose(); m_recordLayer = null; } }
/// <summary> /// Release any contained resources of this SecureChannel object. /// </summary> /// <param name="disposing">set this to true if disposing of managed resources</param> /// <remarks> /// This disposes of the handshake-layer and the record-layer. /// </remarks> protected virtual void Dispose(bool disposing) { if (!disposing) return; if (m_handshakeLayer != null) { m_handshakeLayer.Dispose(); m_handshakeLayer = null; } if (m_recordLayer != null) { m_recordLayer.Dispose(); m_recordLayer = null; } }