我实际上正在开发一个 web 应用程序,我Reactjs用于前端和Golang后端。这两个程序分别托管在Google-Compute-Engine. 我想为我的应用程序提供服务,https所以我选择Nginx用于在生产中为前端提供服务。首先,我为以下内容制作了配置文件Nginx:
#version: nginx/1.14.0 (ubuntu)
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/banshee;
server_name XX.XXX.XX.XXX; #public IP of my frontend VM
index index.html;
location / {
try_files $uri /index.html =404;
}
}
Run Code Online (Sandbox Code Playgroud)
对于这部分,一切都按预期工作,但在那之后,我想https按照本教程为我的应用程序提供服务。我安装的软件包software-properties-common,python-certbot-apache
以及certbot但是当我试图
sudo cerbot --nginx certonly
我收到以下消息:
gdes@frontend:/etc/nginx$ sudo certbot --nginx certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Could not choose appropriate plugin: The …Run Code Online (Sandbox Code Playgroud) 2021 年 9 月 30 日之后,在旧版 Android 7 设备上使用 Let's Encrypt SSL 证书向网站发出 https get/post 请求失败,并出现以下错误:
HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:354))
Run Code Online (Sandbox Code Playgroud)
此错误不会发生在较新的 Android 或 Apple 设备上。
为什么旧的 Android 手机会突然出现此错误?
我该如何解决这个问题?
在www.ssllabs.com上测试我的SSL证书时,我试图在所有类别上获得100分
但是,我很难在所有分数上获得A +和100分.
关于我应该使用什么NGINX配置的任何提示?或者我应该如何生成Let的加密证书?谢谢
几个月前我曾经工作过Let's加密证书(使用旧的letsencrypt客户端).我使用的服务器是nginx.
Certbot正在创建.well-known文件夹,但不是acme-challenge文件夹
现在我尝试通过创建新证书 ~/certbot-auto certonly --webroot -w /var/www/webroot -d domain.com -d www.domain.com -d git.domain.com
但我总是得到这样的错误:
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: git.domain.com
Type: unauthorized
Detail: Invalid response from
http://git.domain.com/.well-known/acme-challenge/ZLsZwCsBU5LQn6mnzDBaD6MHHlhV3FP7ozenxaw4fow:
"<.!DOCTYPE html>
<.html lang='en'>
<.head prefix='og: http://ogp.me/ns#'>
<.meta charset='utf-8'>
<.meta content='IE=edge' http-equiv"
Domain: www.domain.com
Type: unauthorized
Detail: Invalid response from
http://www.domain.com/.well-known/acme-challenge/7vHwDXstyiY0wgECcR5zuS2jE57m8I3utszEkwj_mWw:
"<.html>
<.head><.title>404 Not Found</title></head>
<.body bgcolor="white">
<.center><.h1>404 Not Found</h1></center>
Run Code Online (Sandbox Code Playgroud)
(当然HTML标签内的点不是真的存在)
我找了一个解决方案,但还没找到.有谁知道为什么certbot没有创建文件夹?
提前致谢!
我正在基于Node.js映像的Docker容器中运行基于Express的网站.如何使用基于该图像的容器的Let's Encrypt?
我正在尝试在公共可访问的服务器上配置Let的加密证书.最初,服务器隐藏在路由器后面,但我已经转发了端口80和443.
证书似乎已完成大部分安装过程,但失败并显示以下消息:Failed to connect to host for DVSNI challenge.
完整堆栈跟踪:
Updating letsencrypt and virtual environment dependencies......
Requesting root privileges to run with virtualenv: sudo /bin/letsencrypt certonly --standalone -d example.net -d www.example.net
Failed authorization procedure. example.net (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Failed to connect to host for DVSNI challenge
IMPORTANT NOTES:
- The following 'urn:acme:error:connection' errors were reported by
the server:
Domains: example.net
Error: The server …Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的网站配置 nginx 服务器。我正在使用以下代码来配置我的服务器。如果我为 www.fastenglishacademy.fr (443) 服务器块添加 default_server ,它会起作用。
但在这种情况下,我所有的子域也会带来 www.fastenglishacademy.fr 的内容
如果我删除 default_server,我会收到以下错误:
nginx: [emerg] no "ssl_certificate" is defined for the "listen ... ssl" directive in /etc/nginx/sites-enabled/fastenglishacademy.fr.conf:14
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)
我的 nginx 配置代码:
server {
listen 80;
listen [::]:80;
server_name fastenglishacademy.fr;
return 301 https://www.fastenglishacademy.fr$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name www.fastenglishacademy.fr;
return 301 https://www.fastenglishacademy.fr$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name fastenglishacademy.fr;
return 301 https://www.fastenglishacademy.fr$request_uri;
}
server {
listen 443 …Run Code Online (Sandbox Code Playgroud) [编辑:如果您在这里参加 Let's Encrypt 从 2021 年 1 月开始的到期活动,请先阅读 https://letsencrypt.org/2020/12/21/extending-android-compatibility.html]
在 Android M 或更早版本上通过 OkHttp连接到https://valid-isrgrootx1.letsencrypt.org/失败,而连接在 N 或更高版本上工作。
OkHttpClient client = new OkHttpClient();
try {
Request request = new Request.Builder()
.url("https://valid-isrgrootx1.letsencrypt.org/robots.txt")
.build();
try (Response response = client.newCall(request).execute()) {
assertTrue(response.code() == 200 || response.code() == 404);
assertEquals(Protocol.HTTP_2, response.protocol());
}
} catch (SSLHandshakeException sslhe) {
sslhe.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:322)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:320)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) …Run Code Online (Sandbox Code Playgroud) 如何设置Openshift应用程序以使用let加密?
NB Openshift无法使用简单的python webserver方法处理服务器,您需要使用正确的端口并绑定到正确的IP地址.app/gear也没有必要有html root.
(我将在下面发布答案的问题.)