How to download SSL/TLS certificates in C#

How to download SSL and TLS certificates in CsharpThis article is about how to download (or save) SSL/TLS certificates from any server by use of C#. Although nowadays certificates can be stored quite simply from the web browser, this is always associated with quite a few clicks. And at the latest when you want to store certificates from mail servers, etc., i.e. systems that can not be addressed directly in the web browser, a programmatic solution, as shown in this post, may be the easier way.
All in all, I would like to introduce two variants today. One variant, which works only for HTTPS connections and another variant, which works for all TCP connections (like mail servers, etc.).
Download HTTPS/SSL certificates in C#
The first addressed solution works only for HTTPS connections and […]