“The credentials supplied to the package were not recognized” error when authenticating as server with certificate generated using BouncyCastle

前端 未结 8 2135
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 02:00

I\'m trying to create a certificate using the BouncyCastle.Crypto dll, which is then used to authenticate a SslStream as the server in a Windows Service process, which runs

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 02:37

    I don't recall this error but the certificate you're creating is not a valid to be used for SSL/TLS, including:

    • v1 (not v3) certificate;
    • missing extensions;
    • invalid CN;
    • ...

    There are several RFC that talks about this, including RFC5246 on TLS (1.2).

    Finally making your own certificates is not more suitable than using the ones made by makecert (but the last one can generate the minimum set to be usable for an SSL/TLS server certificate).

    I strongly suggest you to buy, from a good known Certificate Authority (CA), a SSL/TLS certificate for production. That will get you a working certificate recognized by the most browsers and tools.

提交回复
热议问题