Certificate Credentials - Generate Proxy Class

Below you will find my workaround for proxy class generation if remote web service is old-fashioned and protected with certificate credentials.
Often is enough svcutil.exe to generate proxy class. But not in my case because web service was ancient and does not provide MEX, WS or netTcp binding. Please advise whether is possible to use svcutil for archaic service like https://remote.com/service?wsdl
Another way to create proxy class is wsdl.exe utility, but wsdl.exe does not support certificates at all.

Solution: I have installed locally http NGINX revers proxy with following config

    server {
        listen       8080;
        server_name  localhost;

        location / {
     #repace urls in response     
     sub_filter 'https://remote.com:8080/' 'http://$host:8080/';
     sub_filter_types *; # enable all type
     sub_filter_once off;
            proxy_pass https://remote.com:8080/;
            proxy_ssl_certificate  cert.pem;
            proxy_ssl_certificate_key cert.pem;
        }
    }

to convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM file execute
openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes

start Nginx and execute wsdl.exe command
wsdl.exe http://localhost:8080/service?wsdl

Enjoy!


No comments:

HOWTO: Repair Logitech M325 Mouse

FixIt says that you will find single screw under CE label. It isn't always true.