Ciao ,
ti assicuro che funziona con il certificato pubblico del Provider.
nel codice C# ho quanto segue
ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
.....
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
MousetonWSClient client = new MousetonWSClient();
...
io sono assolutamente contrario a farmi dare il loro PFX, ovviamente anche mettendo il PFX nei certificati personali funziona la chiamata.
Ho commentato il mio file config sulla base della documentazione Microsoft
<behavior name="ClientCredentialsBehavior_Mouseton">
<!-- Specifies the credentials used to authenticate the client to a service. -->
<clientCredentials>
<!-- Defines an X.509 certificate used to authenticate a client to a service.
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/wcf/clientcertificate-of-clientcredentials-element
Specifies the certificate used to authenticate the client to the service.
USO IL thumbprint file Mouseton.cer
-->
<clientCertificate findValue="1234" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
<!--
findValue A string that contains the value to search for in the X.509 certificate store
storeLocation Specifies the location of the X.509 certificate that the client uses to authenticate itself to the service.
The default is LocalMachine. LocalMachine: the certificate store assigned to the local machine.
storeName Specifies the name of the X.509 certificate store to search.
The default is My. My: Certificate store for personal certificates.
x509FindType Defines the type of X.509 search to be executed.
FindByThumbprint = The findValue parameter for the Find(X509FindType, Object, Boolean)
method must be a string representing the thumbprint of the certificate
-->
<!-- <serviceCertificate>
Specifies a certificate to use when authenticating a service to the client.
Specifies the certificate used to authenticate the service to the client and provides a structure
for setting certificate options.
This certificate must be supplied out-of-band from the service to the client.
USO IL thumbprint file Mouseton.cer
-->
<serviceCertificate>
<!-- This configuration element specifies the settings used by the client to validate the certificate presented by
the service using SSL authentication.
It also contains any certificate for the service that is explicitly
configured on the client to use for encrypting messages to the service using message security. -->
<!-- <defaultCertificate>
Specifies an X.509 certificate to be used when a service or STS does not provide one via a negotiation protocol.-->
<defaultCertificate findValue="1234" x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="TrustedPeople" />
<!-- The attributes of the serviceCertificate element are identical to the attributes of the <clientCertificate>. -->
<!--
findValue A string that contains the value to search for in the X.509 certificate store
storeLocation Specifies the location of the X.509 certificate that the client uses to authenticate itself to the service.
The default is LocalMachine. LocalMachine: the certificate store assigned to the local machine.
storeName Specifies the name of the X.509 certificate store to search. The default is My.
TrustedPeople: Certificate store for directly trusted people and resources.
x509FindType Defines the type of X.509 search to be executed.
FindByThumbprint = The findValue parameter for the Find(X509FindType, Object, Boolean)
method must be a string representing the thumbprint of the certificate
-->
<!-- Specifies the settings used by the client proxy to authenticate service certificates
that are obtained using SSL/TLS negotiation.-->
<authentication certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine"/>
<!-- certificateValidationMode
Specifies one of three modes used to validate credentials.
If set to Custom, then a customCertificateValidator must also be supplied.
The default is ChainTrust.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.security.x509certificatevalidationmode?view=dotnet-plat-ext-5.0
PeerTrust = The certificate is valid if it is in the trusted people store.
<!-- trustedStoreLocation One of the two system store locations: LocalMachine or CurrentUser.
This value is used when a service certificate is negotiated to the client.
Validation is performed against the Trusted People store in the specified store location.
The default is CurrentUser.
-->
</serviceCertificate>
<!-- Specifies the settings for a Windows credential to be used to represent the client. -->
<windows allowNtlm="false" allowedImpersonationLevel="Anonymous"/>
<!--
allowNtlm="false" Setting this property to false causes Windows Communication Foundation (WCF) to make a best-effort to throw
an exception if NTLM is used.
Note that setting this property to false may not prevent NTLM credentials from being sent over the wire.
allowedImpersonationLevel="Anonymous"
Sets the impersonation preference that the client communicates to the server.
The impersonation mode that the client selects is not enforced on the server.
"Anonymous" = The server cannot impersonate or identify the client.
-->
<!-- Specifies a digest used to authenticate the client to the service. -->
<httpDigest impersonationLevel="Anonymous"/>
<!--impersonationLevel:
Sets the impersonation preference that the client communicates to the server.
The impersonation mode that the client selects is not enforced on the server
Anonymous: The server cannot impersonate or identify the client.
-->
</clientCredentials>
</behavior>