web services - Call WebService in https -
i create webservice generate pdf file. in debug mode visualstudio 2012. it's ok. can call other intranetsite.
i try put on test server. need add https instead of http.
i find this try adapted web.config
<system.servicemodel> <bindings> <basichttpbinding> <binding name="generationcourrierssoap" > <security mode="transport"> <transport clientcredentialtype="none" proxycredentialtype="none" realm="" /> <message clientcredentialtype="certificate" algorithmsuite="default" /> </security> </binding> </basichttpbinding> </bindings> <behaviors> <servicebehaviors> <behavior name="securebehaviours"> <servicemetadata httpsgetenabled="true"/> </behavior> </servicebehaviors> </behaviors> <client> <endpoint address="https://localhost:52999/generationcourrier.asmx" binding="basichttpbinding" bindingconfiguration="generationcourrierssoap" contract="wscourrier.generationcourrierssoap" name="generationcourrierssoap" /> </client> </system.servicemodel>
but i've message
unable establish trust secure channel ssl / tls authority 'localhost: 52999'.
i used auto-certicate buid iis directly. verify, certificate on root , secure folder have idea?
finally find enter link description here
it seems good. can reach webservice.
the idea force validation of certificate. time of test period
imports system imports system.net imports system.security.cryptography.x509certificates public class clsssl public function acceptallcertifications(byval sender object, byval certification system.security.cryptography.x509certificates.x509certificate, byval chain system.security.cryptography.x509certificates.x509chain, byval sslpolicyerrors system.net.security.sslpolicyerrors) boolean return true end function end class
and call function before call webservice function
servicepointmanager.servercertificatevalidationcallback = addressof acceptallcertifications
Comments
Post a Comment