Estoy desarrollando un servicio WCF (NetTcpBinding) y funciona perfectamente sin seguridad. Compramos un certificado de DigiCert, lo instalamos en el servidor y lo configuramos con DigicertUtil.exe. También instalado en las máquinas del cliente de prueba.El certificado remoto no es válido según el procedimiento de validación
Encendiendo la seguridad, puedo conectarlo desde mi PC de desarrollo sin problemas.
servidor de configuración:
binding.Security.Mode = SecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;
binding.Security.Transport.ProtectionLevel = ProtectionLevel.EncryptAndSign;
ServerHost.Credentials.ServiceCertificate.SetCertificate(
StoreLocation.LocalMachine,
StoreName.My,
X509FindType.FindBySubjectName,
Properties.Settings.Default.CertificateName);
de configuración de cliente: (. He modificado el nombre de dominio y servicio para mantener la privacidad del cliente)
<binding name="EndPointTCP" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="1610612736"
maxReceivedMessageSize="1610612736">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="false" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign"/>
</security>
</binding>
<behaviors>
<endpointBehaviors>
<behavior name="behavior_ServerService">
<clientCredentials>
<clientCertificate findValue="*.domain.com"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName" />
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="net.tcp://clients.domain.com:10001/Server/ServerService"
binding="netTcpBinding" bindingConfiguration="EndPointTCP" contract="ServerServiceReference.IServerWS"
name="EndPointTCP" behaviorConfiguration="behavior_ServerService">
<identity>
<dns value="*.domain.com" />
</identity>
</endpoint>
</client>
Tratando desde cualquier otro equipo Recibo el siguiente error en clientes:
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9840000'.
An existing connection was forcibly closed by the remote host
El registro de seguimiento en el servidor dice:
The remote certificate is invalid according to the validation procedure.
que es muy extraño, porque yo uso el mismo certificado tanto en el Sever y el cliente ... (y no hablar de la PC dev de la que se está trabajando así ...)
el mensaje de error es el mismo, incluso si fijo
ServerHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
en el servidor y
ServiceClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
en el cliente.
¿Alguien podría decirme cómo hacerlo correctamente? Por supuesto, no quiero usar soluciones temporales como devolución de llamada de validación siempre verdadera o el modo no validado anterior.
Cualquier ayuda sería apreciada. Sólo este 'pequeño' problema debe ser resuelto para poder liberar ... :(
Muchas gracias por adelantado!
Hudgi
http: // stackoverflow.com/preguntas/777607/la-remote-certificado-is-invalid-acuerdo-a-la-validación-procedimiento-plo copiar y pegar la línea 1 y kaboom :) – ariel