【发布时间】:2011-11-17 14:00:00
【问题描述】:
我正在尝试在定制的 vb.net 应用程序中使用 CRM 2011 部署服务进行 CRM 2011 管理。 请不要告诉我我应该使用部署管理器进行我的操作,因为我必须根据我的组织的特定要求开发这个自定义应用程序。
当我使用 http 时一切正常,但当我尝试使用 SSL 连接调用部署服务方法时(在服务器上启用了 HTTPS)
这是我仅针对 HTTPS/SSL 的相关客户端配置
<binding name="CustomBinding_IDeploymentServiceHttps">
<security defaultAlgorithmSuite="Default" authenticationMode="SspiNegotiatedOverTransport"
requireDerivedKeys="false" securityHeaderLayout="Strict" includeTimestamp="true"
keyEntropyMode="CombinedEntropy" protectTokens="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="true">
<localClientSettings cacheCookies="true" detectReplays="false"
replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
<localServiceSettings detectReplays="false" issuedCookieLifetime="10:00:00"
maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
reconnectTransportOnFailure="true" maxPendingSessions="128"
maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
<secureConversationBootstrap />
</security>
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Default" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" requireClientCertificate="false" />
</binding>
和
<client>
<!-- Deployment Service Endpoints HTTP,HTTPS-->
<endpoint address="http://10.40.30.20:5555/XRMDeployment/2011/Deployment.svc"
binding="customBinding" bindingConfiguration="CustomBinding_IDeploymentService"
contract="CRM2011DeploymentSvc.IDeploymentService" name="CustomBinding_IDeploymentService">
<identity>
<userPrincipalName value="LAB2010\administrator" />
</identity>
</endpoint>
<endpoint address="https://www.mydomain.com/XRMDeployment/2011/Deployment.svc"
binding="customBinding" bindingConfiguration="CustomBinding_IDeploymentServiceHttps"
contract="CRM2011DeploymentSvc.IDeploymentService" name="CustomBinding_IDeploymentServiceHttps" />
</client>
我在我的 asp.net 应用程序中使用以下代码
Dim DomainCredentials As New NetworkCredential(ADUserName, ADPassword, DomainNETBIOS)
If CRMDeploymentServiceURl.Trim().ToLower().StartsWith("https://") Then
_CrmDeployService = New DepSvc.DeploymentServiceClient("CustomBinding_IDeploymentServiceHttps")
Else
_CrmDeployService = New DepSvc.DeploymentServiceClient("CustomBinding_IDeploymentService")
End If
_CrmDeployService.ClientCredentials.Windows.ClientCredential = DomainCredentials
_CrmDeployService.Endpoint.Address = New EndpointAddress(New Uri(CRMDeploymentServiceURl))
_CrmDeployService.Endpoint.Binding.CloseTimeout = New TimeSpan(0, 30, 0)
_CrmDeployService.Endpoint.Binding.OpenTimeout = New TimeSpan(0, 30, 0)
_CrmDeployService.Endpoint.Binding.ReceiveTimeout = New TimeSpan(0, 30, 0)
_CrmDeployService.Endpoint.Binding.SendTimeout = New TimeSpan(0, 30, 0)
以上代码仅用于服务的初始化。稍后当我使用调用方法时 _CrmDeployService 对象,在 http 上一切正常,但在 https 上不行
请告诉我如何在不使用任何客户端证书的情况下与 HTTPS 安全部署服务进行通信。 (来自 DigiCert 的 SSL 证书已安装在服务器上,并且可以在任何 Web 浏览器中通过 SSL 浏览网站。我还需要什么其他证书,为什么?)
IIS 设置也已根据需要完成。 WCf 服务可通过 Web 浏览器通过 SSL/https 浏览。)我已经尝试过匿名身份验证以及通过服务器上的域用户进行身份验证,并且在代码中也进行了相同的处理。
我需要进行任何配置更改吗?这是 WCF 的特定问题吗?我已经尝试过在 stackoverflow 和 msdn 上发布的解决方案,但无济于事。 我无法更改服务器的 web.config 并且我不能使用客户端证书,但我可以使用身份验证所需的任何凭据,并且我必须通过 SSL 实现它。请帮助。谢谢
【问题讨论】:
标签: wcf deployment service ssl dynamics-crm-2011