locked
Howto present a certificate "chain" to AuthenticateAsServer in SslStream RRS feed

  • Question

  • Hello Forum

    The method AuthenticateAsServer from SslStream unfortunately only accepts a single certificate.

    I created a pfx-file which contains my certificates and all intermediate certificates as a chain. I can load this file with X509Certificate2Collection. But how do I pass this chain to a SslStream so that TLS presents the chain and not only a single certificate to the client. Obviously if I import the pfx-file on the client side, everything works fine. But as TLS allows to pass the complete chain to the client it is normally not required to client to import the pfx-file.

    Assuming serverCertificateChain is of type X509Certificate2Collection

    I would expect something like:

    SslStream ssl = new SslStream(cl.GetStream());
    ssl.AuthenticateAsServer(serverCertificateChain);

    Tuesday, December 4, 2018 9:20 AM

All replies

  • Hi Stefan_Ulm,

    Thank you for posting here.

    Sorry for that. Based on my search, the SslStream.AuthenticateAsServer method only support a single certificate.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 5, 2018 7:40 AM
  • Thank your for your reply anyway.

    I hope this will be added in a future release.


    • Edited by Stefan_Ulm Thursday, December 13, 2018 6:54 PM
    Thursday, December 13, 2018 6:54 PM
  • Hi Stefan_Ulm,

    You could post your requirement in the link below.

    https://microsoftteams.uservoice.com/forums/555103-public

    After that, you could post the link back. I will vote the link.

    And please mark the useful reply to close the thread. Thanks.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 17, 2018 8:34 AM