简体   繁体   English

如何为 Linux 应用程序生成证书?

[英]How can I generate a certificate for a Linux app?

I am building my first Client-Server application, with a Secure WebSockets server written in C# and running on Ubuntu.我正在构建我的第一个客户端-服务器应用程序,使用 C# 编写并在 Ubuntu 上运行的安全 WebSockets 服务器。

I am using a client for connecting to the server and exchanging data.我正在使用客户端连接到服务器并交换数据。 The thing is, if I access https://localhost:5000/index.html , my browser assures me the connection is secured.问题是,如果我访问https://localhost:5000/index.html ,我的浏览器会向我保证连接是安全的。 However, if I try to access https://127.0.0.1:5000/index.html , the browser alerts me that the certificate can't be trusted, and so, warns be this connection is not secure.但是,如果我尝试访问https://127.0.0.1:5000/index.html ,浏览器会提醒我证书不可信,因此警告此连接不安全。

My final goal is to access the server from inside my LAN (let's say by accessing https://192.169.0.10:5000/index.html , with 192.168.0.10 being the server's address), and I honestly don't know how to generate a valid certificate.我的最终目标是从我的 LAN 内部访问服务器(假设通过访问https://192.169.0.10:5000/index.html ,其中 192.168.0.10 是服务器的正确地址,生成有效的证书。

And even if I manage to generate one, what should I do with it in order to secure my communication?即使我设法生成了一个,我应该如何处理它以确保我的通信安全? Please help me as this matter is starting to eat a lot of time.请帮助我,因为这件事开始占用很多时间。 Thanks!谢谢!

You can create a self signed SSL snakeoil certificate with just an IP address however this will still show a warning in chrome when a client tries to access your website via HTTPS as you are not a credible authority.您可以使用 IP 地址创建一个自签名 SSL 蛇油证书,但是当客户端尝试通过 Z0E8433F9A404F1F3BA601C14B026D32 访问您的网站时,这仍然会在 chrome 中显示警告。 However despite the warning in chrome network traffic will still be encrypted via HTTPS.然而,尽管 chrome 中的警告网络流量仍将通过 HTTPS 进行加密。

Alternatively Let's Encrypt Certbot issues SSL certificates from a credible authority known as R3 (Let's Encrypt) so chrome will not show a warning message when a client tries to access your website via HTTPS.或者,让我们加密 Certbot 从称为 R3(Let's Encrypt)的可信机构颁发 SSL 证书,因此当客户端尝试通过 HTTPS 访问您的网站时,chrome 不会显示警告消息。 You need a domain name if you want R3 (Let's Encrypt) to issue you an SSL certificate.如果您希望 R3 (Let's Encrypt) 为您颁发 SSL 证书,则需要一个域名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM