我正在尝试为我的WCF服务创建基于证书的身份验证平台,并且我已经完成了所有教程并制作了我的证书并将其安装在IIS中,一切都在本地运行良好,但是很快当我将它发布到Azure时,我得到了异常
Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'LocalMachine', FindType 'FindBySubjectName', FindValue 'CN=tempCert'.
我已将.pvk上传到azure
我已将其置于我的设置中
我确保将其添加到我的网站应用设置
然而,一旦我发布它仍然无效。这是我在服务模型的Web.Config
文件中的配置
<system.serviceModel>
<services>
<service name="clientSecurity">
<endpoint binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding"
name="wsHttpEndpoint" contract="uConnect.Web.IUConnectService" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security>
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client />
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<serviceCertificate findValue="CN=tempCert" x509FindType="FindBySubjectName" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
正如我所提到的,当我在本地运行它时,它完美地工作,只有在我将它发布到azure时才抛出异常。任何帮助都会受到欢迎,因为我现在已经尝试解决这个问题了。
答案 0 :(得分:1)
您需要在Azure WebApps中指定证书存储 - 这些存储在currentUser中加载。将#data in right format, height-variable needs to be numeric
j=data.frame(plot=c("N10-11","N10-14","N13-11","N13-14"),
dbh=as.numeric(c("60.6","68.5","55.6","61.5")),
year=c("2011","2014","2011","2014"))
#check this
> str(j)
'data.frame': 4 obs. of 3 variables:
$ plot: Factor w/ 4 levels "N10-11","N10-14",..: 1 2 3 4
$ dbh : num 60.6 68.5 55.6 61.5
$ year: Factor w/ 2 levels "2011","2014": 1 2 1 2
mycols <- c("red","blue")
barplot(j$dbh, names.arg = j$plot, ylab = "dbh" ,
col = mycols[j$year], ylim=c(0,70))
添加到serviceCertificate元素。