SharePoint 2013 Domain Certificate for Provider-Host App Development Environment
Creating Self-Signed (domain) Certificate for Provider-Hosted App
This is the certificate that will be used on the IIS site to
make it SSL enabled site. It’s different
from the one to create the STS Security token.
If the certificate is not created with proper domain associated, you’ll
have issues with calling the App Event Receivers. To create the certificate and set it up on
IIS, following the instruction below:
- Open Visual Studio Developer Command Prompt and type the following command
makecert -r -pe
-n "CN=spapps.rchen.com" -b 01/01/2013
-e 01/11/2015 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sy
12 -sp "Microsoft RSA SChannel Cryptographic Provider" "D:\ Certs\SPAppCert.cer"
certmgr /add
" D:\ Certs\SPAppCert.cer " /s /r
localMachine root
*** You need to replace the domain (spapps.rchen.com)
with your domain and the file path for the new certificate.
- Open MMC.exe and add Certificates snap-in
- Copy the new certificate from “Personal/Certificates” folder to “Trusted Root Certification Authorities/Certificates” folder.
- Open IIS Manager
- Verify your domain certificate is added
- Bind it to your IIS site
- Add to SharePoint Trust Root Authority through Central Admin
- Security -> Managed Trust -> New
- Enter name and browse to the certificate. Click OK
Errors for Invalid Certificate
If your certificate isn't for correct domain or is invalid, you'll likely get the following errors.
Event Viewer
An operation failed because the
following certificate has validation errors:
Subject Name: CN=server.domain
Issuer Name: CN= server.domain
Thumbprint:
C1E2B38AC0D7F56AEA8906FFA2060AF4E67071E7
Errors:
SSL policy errors have been encountered. Error code '0x2'..
ULS Log
12/10/2013
09:36:28.74 OWSTIMER.EXE
(0x3CF4)
0x30B8 SharePoint
Foundation
Topology
8311 Critical An operation failed because the
following certificate has validation errors: Subject Name: CN= server.domain Issuer Name: CN= server.domain Thumbprint:
B75C19AA3D4CCE373AF8C86D8525212464A6BFF6 Errors: SSL policy
errors have been encountered. Error code
'0x6'.. 6d253d23-f72f-4173-a9a6-79aeaab7e557
12/10/2013
09:36:28.74 OWSTIMER.EXE
(0x3CF4)
0x30B8 SharePoint
Foundation
Dev
Events
ajmb6 High Calling remote event receiver failed.
URL = [https://siteUrl/Branding/Services/AppEventReceiver.svc], App Identifier
=
[i:0i.t|ms.sp.ext|904aa6d3-df40-4d3f-9c09-9880e54ff978@ff5b3346-91e8-4dc3-926d-25c3116cfba6],
Event Type = [AppInstalled], Exception = [Could not establish trust
relationship for the SSL/TLS secure channel with authority 'spapps.rchen.com'.]
6d253d23-f72f-4173-a9a6-79aeaab7e557
*Note: if your environment does not have Visual Studio installed, you can use the following command from another computer to generate the .cer and .pfx files for another server.
makecert -r -pe -n "CN=spapps.rchen.com" -b 01/01/2013 -e 01/11/2017 -sky exchange -sy 12 -sp "Microsoft RSA SChannel Cryptographic Provider" -sv "D:\Certs\SPAppCert.pvk" "D:\Certs\SPAppCert.cer"
pvk2pfx -pvk "D:\SSLCerts\spapps.rchen.com.pvk" -spc "D:\Certs\SPAppCert.cer" -pfx "D:\Certs\SPAppCert.pfx" -pi "Password1"
Manually import into MMC snap-in and IIS site
pvk2pfx -pvk "D:\SSLCerts\spapps.rchen.com.pvk" -spc "D:\Certs\SPAppCert.cer" -pfx "D:\Certs\SPAppCert.pfx" -pi "Password1"
Manually import into MMC snap-in and IIS site
Comments
Also I Want to Share With You 23 Best Dental Websites Build by OptiMized360.