0

我正在尝试配置SSL证书以通过AWS ELB支持HTTPS。我配置了一切:AWS Elastic Load Balancer的SSL证书配置错误

1)在AWS ELB(包括证书链)中配置的GoDaddy SSL证书。
2)让ELB听众看起来像这样:
client ---> HTTPS - > ELB port 443 - > HTTP ---> server port 80
3)在GoDaddy中,创建了一个CNAME条目,例如这样的:
service.acme.com CNAME到aws-some-region.elb.amazonaws.com
4)如果我蜷缩-kv https://service.acme.com/

* Trying 52.6.xxx.xx... 
* Connected to service.acme.com (52.6.xxx.xxx) port 443 (#0) 
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 
* Server certificate: pixxeen.com 
* Server certificate: Go Daddy Secure Certificate Authority - G2 
* Server certificate: Go Daddy Root Certificate Authority - G2 
> GET/HTTP/1.1 
> Host: service.acme.com 
> User-Agent: curl/7.43.0 
> Accept: */* 
> 
< HTTP/1.1 200 OK 
< Accept-Ranges: bytes 
< Content-Type: text/html 
< Date: Mon, 22 Feb 2016 14:06:08 GMT 
< ETag: W/"154-1455797592000" 
< Last-Modified: Thu, 18 Feb 2016 12:13:12 GMT 
< Server: Apache-Coyote/1.1 
< Content-Length: 154 
< Connection: keep-alive 
< 
<html> 
    <head> 
    <title>Acme Service Application</title> 
    </head> 
    <body bgcolor=white> 
     <p>Acme Service Application</p> 
    </body> 
* Connection #0 to host service.acme.com left intact 

的HTML是index.html页面,我有部署给ELB以请求确认EC2实例已启动并正在运行。

不过,我遇到的问题是,如果任何移动客户端框架命中service.acme.com服务端点(okhttp或AFNetworking),我看到以下(这是一个okhttp调用):

02-22 08:52:10.513 2564-2564/com.acme W/System.err: javax.net.ssl.SSLPeerUnverifiedException: Hostname service.acme.com not verified: 
02-22 08:52:10.513 2564-2564/com.acme W/System.err:  certificate: sha1/+axZF3Oyaatuoio5rsmNhUUhOZE= 
02-22 08:52:10.513 2564-2564/com.acme W/System.err:  DN: CN=acme.com,OU=Domain Control Validated 
02-22 08:52:10.513 2564-2564/com.acme W/System.err:  subjectAltNames: [acme.com, www.acme.com] 

那么,有没有人有一个想法,我错了?

我在StackOverflow上划了圈,然后跑到这篇文章(我看过最详细的一篇):Installing SSL cert on Amazon EC2 ELB,它似乎证实了我所做的所有步骤。

回答

0

您的证书无效service.acme.com域名。

这是唯一有效的确切主机acme.comwww.acme.com

你会看到这个错误很明显,如果你省略的curl-k(不安全)选项(这是不是一个很好的测试标志,因为它故意忽略了大多数SSL的问题)

+0

这是我所担心的,它是因为我没有购买允许子域名的证书,对吗?所以,我唯一的选择就是重做这样的CNAME:acme.com CNAME to aws-some-region.elb.amazonaws.com这不是我喜欢的,因为我真的不希望顶级域名指向AWS ELB。 –

+0

@PerryHoekstra无论是这个还是去为服务端点单独的证书。如今它们并不是非常昂贵,可能值得它不必混合网络和服务。 –

相关问题