我正在使用 ASP.NET CORE 2.0 构建电子商务。电子商务有一个使用nodejs和socket.io包构建的聊天室。socket.io 服务器位于远程服务器上。当我在本地使用Socket.io 客户端并运行 Visual Studio 调试器来访问远程 socket.io 时,一切正常。
代码是这样的,注意我没有使用https
var app2 = require('express')();
var http = require('http').Server(app);
var http2 = require('http').Server(app2);
var io = require('socket.io')(http);
http.listen(3009, function () {
console.log('listening on port 3009');
});
http2.listen(3011, function () {
console.log('listening on port 3011');
});
Run Code Online (Sandbox Code Playgroud)
但是当我发布我的网站并获取 html 页面以及 Nginx/kestrel 提供的 socket.io 客户端时,我收到一条错误消息,说我正在混合某些内容,我没有注意该错误消息,因为我记得我在我的服务器socket.io 和客户端上使用http。所以我改变了socket.io服务器和客户端,但现在我无法连接。
我的改变是这样的:
var app2 = require('express')();
var http = require('https').Server(app);
var http2 = require('https').Server(app2);
var io = require('socket.io')(http);
http.listen(3009, function …Run Code Online (Sandbox Code Playgroud) 我知道如何使用命令行安装 ssl 证书。但是这次我需要一个 shell 脚本来完成这个任务。
通常在手动执行此操作时,我首先执行以下操作:-
sudo apt-get install certbot python-certbot-nginx
Run Code Online (Sandbox Code Playgroud)
通过执行上述我将被要求继续或不?[是/否]。我将输入'Y'。然后我将执行以下命令
sudo certbot --nginx
Run Code Online (Sandbox Code Playgroud)
执行上述将要求我按顺序回答以下步骤:
完成所有这些步骤后,https 将被启用。现在我需要通过 shell 文件以编程方式完成这些事情。我想使用这个来安装 certbot 和 python-certbot-nginx
sudo apt-get install certbot python-certbot-nginx -y
Run Code Online (Sandbox Code Playgroud)
但我不知道如何进一步进行,因为我从未使用过 shell 脚本
PS:我在执行 sudo certbot --nginx 并自己输入详细信息时提供示例结果。
sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): mygmailid@gmail.com
- - …Run Code Online (Sandbox Code Playgroud) 我最近在我的 Ubuntu 服务器上安装了 Gitlab CE。我想要运行 Gitlab 的域是https://git.mydomain.com(这是一个示例 URL),所以我更喜欢使用 Lets Encrypt 在服务器上启用 SSL。在安装结束时,我收到此错误:
Running handlers:
There was an error running gitlab-ctl reconfigure:
letsencrypt_certificate[git.mydomain.com] (letsencrypt::http_authorization line 5) had an error: Acme::Client::Error::Malformed: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 25) had an error: Acme::Client::Error::Malformed: Method not allowed
Run Code Online (Sandbox Code Playgroud)
我已经阅读了很多页面来找到解决方案,但没有一个没有用。你能帮我在这个 Gitlab 实例上激活 SSL 吗?
这可能是一个简单的错误,但我似乎无法certbot用来验证我的域。我正在使用连接到快速应用程序的 nginx。我已经注释掉了默认 nginx 文件中的配置,它只包含我的站点的配置/etc/nginx/conf.d/mysite.info。在我的配置中,第一个位置条目指向根/.well-known/acme-challenge目录。这是我的 nginx conf 文件中的设置:
server {
listen 80;
server_name <MYDOMAIN>.info www.<MYDOMAIN>.info;
location '/.well-known/acme-challenge' {
root /srv/www/<MY_ROOT_DIRECTORY>;
}
location / {
proxy_pass http://localhost:4200;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /secure {
auth_pam "Secure zone";
auth_pam_service_name "nginx";
}
}
Run Code Online (Sandbox Code Playgroud)
为了验证,我使用了以下 certbot 命令:
certbot certonly --agree-tos --email <My_EMAIL>@gmail.com --webroot -w /srv/www/<ROOT_FOLDER>/ -d <DOMAIN>.info
Run Code Online (Sandbox Code Playgroud)
certbot的错误如下:
Performing the following challenges:
http-01 challenge for <MYDOMAIN>.info
Using the webroot …Run Code Online (Sandbox Code Playgroud) 我正在评估将我的主网络服务器从 nginx 更改为 caddy 2 的可能性。
有没有办法在 caddy 2 中使用由 certbot 管理的现有 LetsEncrypt 证书?
我试图找到有关在 docker 容器中运行 certbot 的简单文档,但我能找到的只是运行 certbot + web 服务器等的复杂指南。官方页面有点无用... https://hub.docker。 com/r/certbot/certbot/。我已经有与我的网站分开的网络服务器,并且我也想自己运行 certbot。
任何人都可以给我一些关于如何mysite.com使用/opt/mysite/html.
由于我已经在端口 443 和 80 上提供了服务,因此我正在考虑在 certbot 需要时使用“主机网络”,但我不太明白为什么当我的网站已经通过 443 提供服务时它需要访问 443。
我找到了类似的东西来生成 certbot 容器,但我不知道如何“使用它”或告诉它为我的网站生成证书。
例如:
WD=/opt/certbot
mkdir -p $WD/{mnt,setup,conf,www}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'
services:
certbot:
image: certbot/certbot
volumes:
- type: bind
source: /opt/certbot/conf
target: /etc/letsencrypt
- type: bind
source: /opt/certbot/www
target: /var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" …Run Code Online (Sandbox Code Playgroud) 我有一个在专业 Heroku dyno 上运行的 React 应用程序。它有一个带有裸重定向的自定义域,通过 GoDaddy 注册。
\n\n根据 Heroku 说明和我读过的其他 StackOverflow 帖子,我认为我已正确配置所有内容。事实上,当我去的时候,https://www.myapp.herokuapp.com我得到了正确的行为。然而,当我去时https://www.mywebsite.com,我仍然得到:
Your connection is not private. Attackers might be trying to steal your information.
heroku domains是:
=== myapp Heroku Domain\nmyapp.herokuapp.com\n\n=== myapp Custom Domains\nDomain Name DNS Record Type DNS Target \nwww.mywebsite.com CNAME xxx-yyy-1234567.herokudns.com \nRun Code Online (Sandbox Code Playgroud)\n\n该 DNS 地址是我在 GoDaddy 中设置的 CNAME 指向的地址:
\n\nCNAME www xxx-yyy-1234567.herokudns.com 1 Hour\nRun Code Online (Sandbox Code Playgroud)\n\nheroku certs是:
Name Common Name(s) Expires Trusted Type\n\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 …Run Code Online (Sandbox Code Playgroud) 我在运行 Apache 的 AWS EC2 实例上有一个 Ubuntu 20.04 服务器,我正在尝试使用 certbot 获取证书,但是我在获取凭据时遇到了问题。下面是我运行的命令,后面是错误输出:
user@address:~$ sudo certbot certonly --dns-route53 --dns-route53-propagation-seconds 30 -d mydomain.com -d *.mydomain.com -i apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator dns-route53, Installer apache
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for mydomain.com
dns-01 challenge for mydomain.com
Cleaning up challenges
Unable to locate credentials
To use certbot-dns-route53, configure credentials as described at https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials and add the necessary permissions for Route53 access.
Run Code Online (Sandbox Code Playgroud)
我遵循了以下指南:
我正在尝试使用 certbot 和 --webroot 设置获取 SSL 证书。我当前的命令是:
sudo certbot certonly --webroot -w <path> -d <URL> -d <*.URL>
Run Code Online (Sandbox Code Playgroud)
每次运行该命令时,我都会收到此错误:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. You may need to use an authenticator plugin that can do challenges over DNS.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA. You may need to use an authenticator plugin that can do challenges …Run Code Online (Sandbox Code Playgroud) 我目前有一个在 GCP 上运行的 Kubernetes 集群。在这个集群中,我有一个有效的 NGINX Ingress,但现在我正在尝试使用 cert-manager 为其添加证书。
除了 ACME 挑战之外,一切正常。当我做 a 时,kubectl describe challenge我得到以下信息:
Status:
Presented: true
Processing: true
Reason: Waiting for HTTP-01 challenge propagation: failed to perform self check GET request
Run Code Online (Sandbox Code Playgroud)
当 acme 挑战创建求解器服务时,我在 GCP 上收到以下错误消息:
"All hosts are taken by other resources"
Run Code Online (Sandbox Code Playgroud)
我试图创建一个Issuer和ClusterIssuer,但同样的问题不断出现。
google-cloud-platform kubernetes lets-encrypt cert-manager nginx-ingress
lets-encrypt ×10
certbot ×5
nginx ×2
acme ×1
apache ×1
caddy ×1
cert-manager ×1
certificate ×1
docker ×1
git ×1
gitlab ×1
heroku ×1
https ×1
kubernetes ×1
node.js ×1
shell ×1
socket.io ×1
ssl ×1
ubuntu ×1
webserver ×1