While trying to use the Reportviewer to render a remote report I received the error: "The remote certificate is invalid according to the validation procedure".
The webserver on which the application with the viewer runs has to access the reportserver over SSL.
The first thing I did was trying to load the report from within IE. IE showed an error that the certificate was not issued by a trusted root certification authority. This is correct since we created the certificate ourselfs.
After installing the certificate the report showed without any error in IE. However, when trying to show the report by using the application with the reportviewer I still got the same error.
It looked like the application wasn't able to find or load the certificate despite the fact I installed it.
The solution is simple (isn't that true in most cases). When you install a certificate that certificate is installed for the current user. Since IIS runs with it's own account (IIS 6.0 default = Network Service) it has no access to 'my' certification stores.
- First save the certificate in a file
- Run MMC
- Open the Certificate Manager (certmgr.msc in C:\Windows\System32)
You will see it opens 'Certificates - Current User'
- In the menu, choose File, Add/Remove Snap-In
- Now press Add, select 'Certificates' and select 'Computer Account'
- Select the Local Computer
- Now you have two snap-ins:
- Certificates - Current User
- Certificates (Local Computer)
- Now import the certificate in "Certificates (Local Computer)\Trusted Root Certificates\Certificates"
Now every'one' one this computer will be able to use the certificate, including the Network Service.