/// <summary> /// 初始化SSL环境 /// </summary> /// <returns></returns> public virtual bool Initialize() { if (pAgent != IntPtr.Zero) { PemCertFile = string.IsNullOrWhiteSpace(PemCertFile) ? null : PemCertFile; PemKeyFile = string.IsNullOrWhiteSpace(PemKeyFile) ? null : PemKeyFile; KeyPasswod = string.IsNullOrWhiteSpace(KeyPasswod) ? null : KeyPasswod; CAPemCertFileOrPath = string.IsNullOrWhiteSpace(CAPemCertFileOrPath) ? null : CAPemCertFileOrPath; return(SSLSdk.HP_SSLAgent_SetupSSLContext(pAgent, VerifyMode, PemCertFile, PemKeyFile, KeyPasswod, CAPemCertFileOrPath)); } return(true); }
/// <summary> /// 初始化SSL环境 /// </summary> /// <returns></returns> protected virtual bool Initialize() { lock (SSLInitLock) { //if (SSLSdk.HP_SSL_IsValid() == false) { PemCertFile = string.IsNullOrWhiteSpace(PemCertFile) ? null : PemCertFile; PemKeyFile = string.IsNullOrWhiteSpace(PemKeyFile) ? null : PemKeyFile; KeyPasswod = string.IsNullOrWhiteSpace(KeyPasswod) ? null : KeyPasswod; CAPemCertFileOrPath = string.IsNullOrWhiteSpace(CAPemCertFileOrPath) ? null : CAPemCertFileOrPath; var ret = SSLSdk.HP_SSLAgent_SetupSSLContext(pAgent, VerifyMode, PemCertFile, PemKeyFile, KeyPasswod, CAPemCertFileOrPath); System.Diagnostics.Trace.WriteLine($"ssl Initialize : {ret}"); } return(true); } }