Troubles with Self signed certificate in Office Addin for testing

lars wissler 26 Reputation points

My previous self signed certificate has expired and I just cannot get a new one to work even after following multiple tutorials. This one was the latest. Whenever I try to use the localhost server, Office refuses to load the addin, because the certificate is invalid.

I think the issue is: When I import the certificate in Edge, it states "Import successful", but the certificate will not appear in the certificates list. I read here, that a missing private key might cause that issue. I tried fixing that with digicert utils, as suggested. But importing the certificate in digicert only shows the message "The file does not have any SSL or code signing enabled certificates contained in it."

My certificate looks valid, except it does not show the "protected by private key" info. It looks like that issue here. If I try to repair as proposed in that link, certutil asks to connect a smart card. Never heard of that.

As per the first tutorial, I created a root certification authority with key and imported it into the Trusted Root Certification Authorities. I the used the root.pem to create localhost.key/.csr and finally localhost.crt. I cannot see a fault with the process or the certificate except for the missing private key information (see attached image, Edit: Image upload does nothing, here is the link to the image.).

Please help, I am going nuts over this. Why does it not say there is a corresponding private key or if that is outdated, why is it not importing into Edge. Do I even need to get it imported into Edge for Office JS Addings to work. I am utterly confused by now. The commands I used to create the files are:

openssl genrsa -des3 -out rootSSL.key 2048
openssl req -x509 -new -nodes -key rootSSL.key -sha256 -days 10240 -out rootSSL.pem
openssl req -new -sha256 -nodes -out localhost.csr -newkey rsa:2048 -keyout localhost.key
openssl x509 -req -in localhost.csr -CA rootSSL.pem -CAkey rootSSL.key -CAcreateserial -out localhost.crt -days 50000 -sha256

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,180 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
905 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,595 questions
{count} votes

1 answer

Sort by: Most helpful
  1. lars wissler 26 Reputation points

    With some help I managed the correct certificat and import procedure. The solution can be found here:

    0 comments No comments