我正在尝试使用高级 REST 客户端 6.7.2 访问 6.x ES 实例。\n通过主机名 (https://****.azureedge.net)、用户名和密码向我提供对此 ES 实例的访问权限。
\n\n当我的 Spring Boot 应用程序从我的开发环境 (IDE) 运行时,它可以毫无问题地从同一个 ES 获取数据,但当我尝试从 Docker 容器(从我的开发机器或云中的 K8s 集群)运行它时,就会抛出 SSLHandshakeException。
\n\nFROM debian:stretch-slim
容器由基础镜像和OpenJDK 11.0.2
Spring Boot 必要模块组成。
我使用 进行调试取得了一些进展-Djavax.net.debug=all
。事实证明,在 docker 镜像中运行时,只发生了通常 SSL 握手的几个第一步:
Produced ClientHello handshake message\nWRITE: TLS13 handshake, length = 2352\nRaw write\nRaw read (0000: 15 03 03 00 02 02 28 ......( )\nREAD: TLSv1.2 alert, length = 2\nReceived alert message (\n "Alert": {\n "level" : "fatal",\n "description": "handshake_failure"\n …
Run Code Online (Sandbox Code Playgroud) 环境:Ubuntu 和 Apache。
尝试设置从 http 到 https 的自动重定向。
我努力了:
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile <path to your crt file>
SSLCertificateKeyFile <path to your private key file>
# ...
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
和
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
Run Code Online (Sandbox Code Playgroud)
从 mydomain.com --- 至 ---> (https://) mydomain.com
有任何想法吗?
当我尝试通过命令克隆存储库时
git clone https://git.lighttpd.net/mirrors/libev.git
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
fatal: unable to access 'https://git.lighttpd.net/mirrors/libev.git/': server certificate verification failed. CAfile: none CRLfile: none
如果设置 GIT_CURL_VERBOSE=1
Cloning into 'libev'...
* Couldn't find host git.lighttpd.net in the .netrc file; using defaults
* Trying 5.9.70.195:443...
* TCP_NODELAY set
* Connected to git.lighttpd.net (5.9.70.195) port 443 (#0)
* found 387 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
* server certificate verification failed. CAfile: none CRLfile: none
* Closing …
Run Code Online (Sandbox Code Playgroud) 我在 docker 容器中运行 debian 9,今天我无法更新让我们在容器内加密的根证书。在主机 Ubuntu 20 上,一切都可以正常工作,无需我的任何干预,但在我的 debian 容器上,我无法获得新的根 Lets Encrypt 证书,只有从头开始的娱乐容器有帮助。我尝试过update-ca-certificates --fresh
,但没有帮助。有任何想法吗?
由于此问题,从内部容器向带有 Lets Encrypt 证书的 https 服务的请求失败,并显示“SSL 证书问题:证书已过期”,因为 Lets Encrypt 的根证书今天过期(2021 年 9 月 30 日)
很难将成功的 Postman 请求转换为 C# 中的成功请求。使用 HttpClient 显示我的代码,但也尝试使用 PostSharp 和 HttpRequest。我正在使用带有密码的本地 pfx 证书文件。
在邮递员中:
发送成功(200)。
使用 HttpClient:
var host = @"https://thehost/service/verb?param1=blah¶m2=1111111";
const string certName = @"C:\Key.pfx";
const string userName = "userName";
const string certPassword = "password1";
const string authPassword = "password2";
var handler = new HttpClientHandler();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
// tried many combinations here
handler.SslProtocols = SslProtocols.Tls | SslProtocols.Tls11 |
SslProtocols.Tls12 | SslProtocols.Tls13;
var cert = new X509Certificate2(certName, certPassword);
handler.ClientCertificates.Add(cert);
//not sure if …
Run Code Online (Sandbox Code Playgroud) 我试图从共享托管服务器请求第三方服务器的 API,所以我没有 root 访问权限,并收到此错误,但是当我在失眠中尝试它时,它正常工作,显然是由于它的原因代理或证书。已经尝试httpsAgent: new https.Agent({ rejectUnauthorized: false })
在 axios 请求选项中使用,并尝试过 NODE_TLS_REJECT_UNAUTHORIZED=0
,但没有成功。我没有粘贴证书和服务器信息信息,但如果有必要,我可以分享它。这就是我提出请求的方式:
async appInfo(){
var config = {
method: 'get',
url: `${this.url}/api/v2/me/shipment/app-settings`,
headers: {
'Accept': 'application/json',
'Authorization':`Bearer ${this.bearer}`,
'User-Agent': this.user_agent
}
};
var response = await axios(config)
console.log(JSON.stringify(response.data));
}
Run Code Online (Sandbox Code Playgroud)
我打算使用 Gcloud 托管证书。它的工作方式是,我已经有一个由 Let's Encrypt 管理的自定义证书,该证书已分配给我的 LoadBalancer。现在我想切换到 Google 托管证书。为了实现这一点,我必须将域指向 LoadBalancer 的 IP,然后转到负载平衡组件页面,然后我必须在“证书”选项卡上创建 Google 托管证书,最后编辑 LoadBalancer 以更改其前端配置HTTPS 协议并选择新创建的证书。然后,只有到那时,GCP 才可以提供证书。问题是可能需要几分钟(例如 10 分钟)才能配置证书。在此期间,我的应用程序最终将丢失证书,并且浏览器将阻止它。这对我们来说不是可接受的情况。
因此,简而言之,我需要将 LoadBalancer 的证书替换为另一个尚未验证的证书,这将导致我的应用程序在配置它所需的时间内无法使用。理想的情况是首先配置证书,然后编辑 LoadBalancer 以将其与新证书绑定。
有什么办法可以实现这一点吗?否则,我仍然必须使用 Let's Encrypt 颁发证书,并在每次证书即将过期时手动替换它。
ssl-certificate google-cloud-platform google-cloud-networking google-cloud-load-balancer gcp-load-balancer
因此,我尝试为我的 AWS Lambda 函数设置自定义域。
我完成了通过 google 域购买域名的所有说明,通过 AWS 证书管理器设置证书,并创建了相应的路由 53 托管区域。
无论出于何种原因,当我尝试访问 API 网关域名端点时,不幸的是收到 403 错误。在本例中,它是https://d-frdw0740fd.execute-api.us-east-1.amazonaws.com。
另外,为了了解上下文,这里是我的 API 映射选项卡。
有关更多背景信息,以下是与我的自定义域名对应的路由 53 中的托管区域:
我希望它不会将我带到某个{"message": "Not Found"}
页面,而是将我带到实际的 aws 端点。
为了设置我的配置以使我的 API 网关域名正确链接到功能性 aws 终端节点而不是仅仅出现 404 错误,我在哪里出错了?
更新:我重新部署了我的无服务器功能,而不是现在得到 404Not Found
错误而不是得到 403 Forbidden
:
{
"message": "Forbidden"
}
Run Code Online (Sandbox Code Playgroud) 我有一个 Google Cloud SQL 实例,我希望后端 API 和数据库之间的连接尽可能安全。我已在实例设置中指定“仅允许 SSL 连接”。我正在使用 Google 生成的 SSL 证书,但是我很难弄清楚如何安全连接。
当我使用以下方式连接时:
return mysql.createPool({
host: db_host,
port: 3306,
user: db_user,
password: db_password,
ssl: {
rejectUnauthorized: false,
key: clientKey,
cert: clientCert,
ca: serverCa,
},
});
Run Code Online (Sandbox Code Playgroud)
它工作正常,但是使用“rejectUnauthorized: false”显然不安全。
如果我删除“rejectUnauthorized: false”,则会收到错误
'Hostname/IP does not match certificate's altnames: IP: ##.##.##.## is not in the cert's list:'
Run Code Online (Sandbox Code Playgroud)
我似乎需要使用主机名进行连接,但是 Cloud SQL 没有提供使用主机名进行连接的选项。
有谁知道如何解决这个问题?
我是SSL的新手,想在GLASSFISH上为我的应用程序安装SSL,虽然试图找到一些可以从基础教我的教程,但却无法找到任何精细的解决方案.1)比如如何为SSL生成自签名证书?2)如何使用我的应用程序配置此证书?3)如何在SSL上仅配置LOGIN页面?4)这个openSSL是什么,它如何在应用程序中使用?
ssl-certificate ×10
ssl ×5
docker ×2
apache ×1
aws-lambda ×1
axios ×1
c# ×1
debian ×1
git ×1
java ×1
lets-encrypt ×1
lighttpd ×1
node.js ×1
openssl ×1
postman ×1
proxy ×1
request ×1
security ×1
server ×1
spring-boot ×1
ubuntu-16.04 ×1