.net - Performing SSL Server Verification in C# -
i work on code connects server retrieve configuration file. required happens in secure way via https. discovered current implementation not meet requirement:
httpwebrequest httpwebrequest = (httpwebrequest)webrequest.create("https://www.configserver.com/..."); if (reloadglobals.ignoresslerrors) // true httpwebrequest.authenticationlevel = authenticationlevel.none; if (m_reloadconfig.dontchecksslcert) // true servicepointmanager.servercertificatevalidationcallback += new remotecertificatevalidationcallback(onchecksslcert); httpwebesponse = (httpwebresponse)httpwebrequest.getresponse(); the remote callback implemented in way:
private static bool onchecksslcert(object sender, system.security.cryptography.x509certificates.x509certificate certificate, system.security.cryptography.x509certificates.x509chain chain, sslpolicyerrors sslpolicyerrors) { return true; } i dont know https can see doesn't make sense , looks workaround. need find way implement in proper way.
i'm thankful every piece of advice.
edit: part of requirements:
once address , url configuration server determined, peer must form https connection ip address. if optional url configuration server provided, certificate must match domain name url described in [rfc2818]; otherwise certificate must match overlay name described in [rfc2818]. if https certificates passes name matching, node must fetch new copy of configuration file.
Comments
Post a Comment