Activate Information Rights Management in SharePoint

Recently we had a case where a customer was having some difficulty activating an IRM-protected document library in SharePoint on a server running Windows Server 2008. He got the following error:

Information Rights Management (IRM): There was a problem while trying to activate a rights account certificate.
Unspecified connection error. Try activating again later.

Error value: 8004cf3b

A common cause of this error is that the SharePoint server cannot contact the AD RMS server, due to a 502 Proxy Gateway error.

To resolve this issue: You can set WinHTTP proxy settings on Windows Server 2008 or Windows Server 2008 R2 using the Netsh command-line tool. You can add the AD RMS Server URL to the proxy bypass list on the computer that is running SharePoint to enable it to bootstrap correctly. The following is an example where https://myRmsServer is added to the proxy bypass list:

netsh winhttp set proxy proxy-server="myProxyServer.mydomain.corp.contoso.com:80" bypass-list= https://myRmsServer