gpt4 book ai didi

amazon-web-services - CloudFront 无法连接到源

转载 作者:太空宇宙 更新时间:2023-11-03 12:43:27 27 4
gpt4 key购买 nike

我已经通过 http 正确设置了 Cloudfront。它从我的网站 (dev.pie.video) 获取数据很好。我现在转向 https。 https://dev.pie.video 一切正常,但 Cloudfront 无法提供任何内容服务器。例如https://dev.pie.video/favicon-96x96.png有效但https://d1mbpc40mdbs3p.cloudfront.net/favicon-96x96.png失败,状态为 502,即使我的 Cloudfront 分发 d1mbpc40mdbs3p 指向 dev.pie.video

如果有帮助,请提供更多详细信息:

  • d1mbpc40mdbs3p.cloudfront.net 使用 https 的默认 CloudFront 证书
  • 云端分发的来源设置为通过 SSL 和 TLS 工作,并使用查看器的协议(protocol)。

===== 编辑 1 =====

云端设置的屏幕截图:

一般: enter image description here

来源:

enter image description here

行为:

enter image description here enter image description here

==== 编辑 2 ====

如果这有帮助,我从云端获取的日志看起来像

<timestamp> SFO20   924 96.90.217.130   GET d1mbpc40mdbs3p.cloudfront.net   /favicon-96x96.png  502 -   <someInfoOnTheClientBrowser>    2   -   Error   poZyhl63JNGFk8dIIjCluGDm4dxF8EdMZFhjg82NgHGPNqcmx6ArHA==    d1mbpc40mdbs3p.cloudfront.net   https   494 0.002   -   TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Error   HTTP/1.1

最佳答案

您的源服务器未正确配置 SSL。 CloudFront 需要有效的配置,并且可能比某些浏览器更严格——因此浏览器中的绿色锁定并不一定意味着您的 SSL 设置已完成并且与所有客户端普遍兼容。

$ true | openssl s_client -connect dev.pie.video:443 -showcerts
CONNECTED(00000003)
depth=0 OU = Domain Control Validated, CN = dev.pie.video
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, CN = dev.pie.video
verify error:num=27:certificate not trusted
verify return:1
depth=0 OU = Domain Control Validated, CN = dev.pie.video
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/OU=Domain Control Validated/CN=dev.pie.video
i:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2
-----BEGIN CERTIFICATE-----
MIIFMzCCBBugAwIBAgIJAL96wtFpu1ZpMA0GCSqGSIb3DQEBCwUAMIG0MQswCQYD
VQQGEwJVUzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEa
MBgGA1UEChMRR29EYWRkeS5jb20sIEluYy4xLTArBgNVBAsTJGh0dHA6Ly9jZXJ0
cy5nb2RhZGR5LmNvbS9yZXBvc2l0b3J5LzEzMDEGA1UEAxMqR28gRGFkZHkgU2Vj
dXJlIENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTE2MDgwODE4MzQ0MFoX
DTE3MDgwODE4MzQ0MFowOzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh
dGVkMRYwFAYDVQQDEw1kZXYucGllLnZpZGVvMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAz/wT5j/zHKzmt3oRvst74Knqxc0pl3sp5imUJ7UegoxcTISm
xJC5qQiDsD0U08kAFxvXDd91jlozh4QDcfLE8N7X9fsxC7OW2pDv3ks/LO7tiCxn
gNmxjvYvOQ/vASrLHIal+oGWJNdBMB1eckV4xHCeBDDEizDneq/qvjN0M0k5hQ+/
qk7RjVhJUmFAfvhXpxXaCbVDq1d3V1iRBo3oP3SGV++bj/m55QPFfKCZqGPTiM5G
c9+8ru16EVCpvs0wCWBVxjTiOCGtrMLgvp9LOs8AN369Yk/3AynpgAI0DDhb5y8I
KEuCdbUaIg5Zo029iZz4nWRsZFd5CSwgX8tZNQIDAQABo4IBvjCCAbowDAYDVR0T
AQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH/
BAQDAgWgMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly9jcmwuZ29kYWRkeS5jb20v
Z2RpZzJzMS0yODIuY3JsMF0GA1UdIARWMFQwSAYLYIZIAYb9bQEHFwEwOTA3Bggr
BgEFBQcCARYraHR0cDovL2NlcnRpZmljYXRlcy5nb2RhZGR5LmNvbS9yZXBvc2l0
b3J5LzAIBgZngQwBAgEwdgYIKwYBBQUHAQEEajBoMCQGCCsGAQUFBzABhhhodHRw
Oi8vb2NzcC5nb2RhZGR5LmNvbS8wQAYIKwYBBQUHMAKGNGh0dHA6Ly9jZXJ0aWZp
Y2F0ZXMuZ29kYWRkeS5jb20vcmVwb3NpdG9yeS9nZGlnMi5jcnQwHwYDVR0jBBgw
FoAUQMK9J47MNIMwojPX+2yz8LQsgM4wKwYDVR0RBCQwIoINZGV2LnBpZS52aWRl
b4IRd3d3LmRldi5waWUudmlkZW8wHQYDVR0OBBYEFEPW+uDOOtZfUEdXuBs+960C
zQRKMA0GCSqGSIb3DQEBCwUAA4IBAQBLkLYJEc9E+IGv6pXaPCcYowJfji651Ju6
3DNzGXdyWfOXG+UVCMtPZuC9J66dID4Rc7HWzLveTPEI32z4IgtSjvRwRk9YyWVx
uCOpsP3e/Vgriwg5ds4NyrelQfshA3KaiTLohuiVEOBZgZgIwBEmwR2ZNFuL375E
uEn909zF9+sGkTbFnMm1zlqB2oh2UlSkUT3mj009vWF416W6kZQdFFFEmaI8uSmo
+Thd8HSxQytzWvB3dR4lCteiC09lkQPHU5t10tPgK9BtkLv05ICQQoDhFJmLeAcC
WNEmCcDnSHPxXjPi8kcyM6aqNofL1D0e1pYYvcpYQQDayWdY3tUh
-----END CERTIFICATE-----
---
Server certificate
subject=/OU=Domain Control Validated/CN=dev.pie.video
issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2
---
No client certificate CA names sent
---
SSL handshake has read 2010 bytes and written 431 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
...clipped...

您的证书由“Go Daddy Secure Certificate Authority - G2”签署,这是一个中间证书(不是根证书),并且您没有在您的服务器上安装该中间证书——因此 CloudFront 报告它是“无法”连接,实际上更准确地说是“不愿意”连接,作为安全预防措施,因为它无法验证您的 SSL 证书的有效性。您应该在 Web 服务器的日志中将这些视为 SSL 协商失败。连接本身正常,但 CloudFront 认为它无效,因此由于信任问题使用不安全。

Caution

If the origin server returns an expired certificate, an invalid certificate or a self-signed certificate, or if the origin server returns the certificate chain in the wrong order, CloudFront drops the TCP connection, returns HTTP error code 502, and sets the X-Cache header to Error from cloudfront.

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html

将您的中间证书添加到您的服务器配置中,您应该设置好了。这应该在您下载时与证书捆绑在一起,但如果没有,它可以从您的 CA 获得,在本例中为 Go Daddy。

这不是特定于 Go Daddy 证书的限制。遵循标准做法的所有 CA 使用中间证书来建立信任链,回到受信任的根。

另见:

https://www.godaddy.com/help/what-is-an-intermediate-certificate-868

https://certs.godaddy.com/repository

关于amazon-web-services - CloudFront 无法连接到源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38839693/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com