# Failed to validate the SSL certificate for github.com:443 while executing ansible-container build

**URL:** <https://forum.ansible.com/t/failed-to-validate-the-ssl-certificate-for-github-com-443-while-executing-ansible-container-build/25973>\
**Category:** Ansible Developer\
**Created:** [November 9, 2017, 10:56am UTC](https://forum.ansible.com/t/failed-to-validate-the-ssl-certificate-for-github-com-443-while-executing-ansible-container-build/25973 "2017-11-09T10:56:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManiGandan\_T](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@ManiGandan\_T](https://forum.ansible.com/u/ManiGandan_T)\
**Post date:** [November 9, 2017, 10:56am UTC](https://forum.ansible.com/t/failed-to-validate-the-ssl-certificate-for-github-com-443-while-executing-ansible-container-build/25973/1 "2017-11-09T10:56:08Z")

</div>

My main.yml is executing a task called dumb-init and we are getting “msg”: "Failed to validate the SSL certificate for [github.com:443](http://github.com:443/). Make sure your managed systems have a valid CA certificate installed " error

##### STEPS TO REPRODUCE

Command used : sudo ansible-container --debug build

Main.yml

- name: Install dumb init  
get\_url:  
url: [https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init\_1.2.0\_amd64](https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64)  
dest: /usr/bin/dumb-init  
owner: root  
group: root  
mode: 0775  
environment:  
http\_proxy: “[http://xxx-proxy-out.xxx.com:8080](http://xxx-proxy-out.xxx.com:8080/)”  
https\_proxy: “[http://xxx-proxy-out.xxxx.com:8080](http://xxx-proxy-out.xxxx.com:8080/)”  
HTTP\_PROXY: “[http://xxx-proxy-out.xxxx.com:8080](http://xxx-proxy-out.xxxx.com:8080/)”  
HTTPS\_PROXY: “[http://xx-proxy-out.xxx.com:8080](http://xx-proxy-out.xxx.com:8080/)”  
COmmand Used : sudo ansible-container --debug build

Log:  
META: ran handlers  
TASK [node\_container : Install dumb init] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /src/roles/node\_container/tasks/main.yml:2  
Using module file /usr/lib/python2.7/site-packages/ansible/modules/net\_tools/basics/get\_url.py  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> ESTABLISH DOCKER CONNECTION FOR USER: root  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> EXEC [‘/usr/local/bin/docker’, ‘exec’, ‘-i’, u’6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98’, u’/bin/sh’, ‘-c’, u"/bin/sh -c ‘echo ~ && sleep 0’“]  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> EXEC [‘/usr/local/bin/docker’, ‘exec’, ‘-i’, u’6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98’, u’/bin/sh’, ‘-c’, u’/bin/sh -c ‘( umask 77 && mkdir -p “`echo /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135`” && echo ansible-tmp-1510211281.96-149794489024135=“`echo /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135`” ) && sleep 0’‘]  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> PUT /tmp/tmpUO7dPT TO /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135/get\_url.py  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> EXEC [’/usr/local/bin/docker’, ‘exec’, ‘-i’, u’6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98’, u’/bin/sh’, ‘-c’, u”/bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135/ /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135/get\_url.py && sleep 0’"]  
\<6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98\> EXEC [‘/usr/local/bin/docker’, ‘exec’, ‘-i’, u’6e2a9499e5b3dc4c4748b72955de0d3784a01489b93b3f0c03851fd697a54c98’, u’/bin/sh’, ‘-c’, u’/bin/sh -c ‘https\_proxy=[http://prod-proxy-out.xxx.com:8080](http://prod-proxy-out.xxx.com:8080/) http\_proxy=[http://prod-proxy-out.xxx.com:8080](http://prod-proxy-out.xxx.com:8080/) HTTPS\_PROXY=[http://prod-proxy-out.xxxx.com:8080](http://prod-proxy-out.xxxx.com:8080/) HTTP\_PROXY=[http://prod-proxy-out.xxx.com:8080](http://prod-proxy-out.xxx.com:8080/) /\_usr/bin/python /root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135/get\_url.py; rm -rf “/root/.ansible/tmp/ansible-tmp-1510211281.96-149794489024135/” \> /dev/null 2\>&1 && sleep 0’‘]  
The full traceback is:  
File “/tmp/ansible\_eDZL6J/ansible\_modlib.zip/ansible/module\_utils/urls.py”, line 1046, in fetch\_url  
client\_key=client\_key, cookies=cookies)  
File “/tmp/ansible\_eDZL6J/ansible\_modlib.zip/ansible/module\_utils/urls.py”, line 953, in open\_url  
r = urllib\_request.urlopen(\*urlopen\_args)  
File “/\_usr/lib/python2.7/urllib2.py”, line 154, in urlopen  
return opener.open(url, data, timeout)  
File “/\_usr/lib/python2.7/urllib2.py”, line 427, in open  
req = meth(req)  
File “/tmp/ansible\_eDZL6J/ansible\_modlib.zip/ansible/module\_utils/urls.py”, line 765, in http\_request  
build\_ssl\_validation\_error(self.hostname, self.port, paths\_checked, e)  
File “/tmp/ansible\_eDZL6J/ansible\_modlib.zip/ansible/module\_utils/urls.py”, line 591, in build\_ssl\_validation\_error  
raise SSLValidationError(’ ‘.join(msg) % (hostname, port, ", ".join(paths)))  
fatal: [ansible.node-container]: FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“attributes”: null,  
“backup”: null,  
“checksum”: “”,  
“client\_cert”: null,  
“client\_key”: null,  
“content”: null,  
“delimiter”: null,  
“dest”: “/usr/bin/dumb-init”,  
“directory\_mode”: null,  
“follow”: false,  
“force”: false,  
“force\_basic\_auth”: false,  
“group”: “root”,  
“headers”: null,  
“http\_agent”: “ansible-httpget”,  
“mode”: 509,  
“owner”: “root”,  
“regexp”: null,  
“remote\_src”: null,  
“selevel”: null,  
“serole”: null,  
“setype”: null,  
“seuser”: null,  
“sha256sum”: “”,  
“src”: null,  
“timeout”: 10,  
“tmp\_dest”: null,  
“unsafe\_writes”: null,  
“url”: “[https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init\_1.2.0\_amd64](https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64)”,  
“url\_password”: null,  
“url\_username”: null,  
“use\_proxy”: true,  
“validate\_certs”: true  
}  
},  
“msg”: “Failed to validate the SSL certificate for [github.com:443](http://github.com:443/). Make sure your managed systems have a valid CA certificate installed. You can use validate\_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/[cacert.org](http://cacert.org/), /etc/ansible. The exception msg was: [SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed (\_ssl.c:590).”  
}  
to retry, use: --limit @/tmp/tmpAZLAaM/playbook.retry  
PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ansible.node-container : ok=1 changed=0 unreachable=0 failed=1  
2017-11-09T07:08:02.678075 Error applying role! [container.core] caller\_file=/\_ansible/container/core.py caller\_func=apply\_role\_to\_container caller\_line=680 engine=\<container.docker.engine.Engine object at 0x7f5b840bf710\> exit\_code=2 playbook=[{‘hosts’: u’ansible.node-container’, ‘roles’: [‘node\_container’], ‘vars’: {}}]  
2017-11-09T07:08:02.684010 Playbook run finished. [container.core] caller\_file=/\_ansible/container/core.py caller\_func=conductorcmd\_build caller\_line=811 exit\_code=2  
Traceback (most recent call last):  
File “/usr/bin/conductor”, line 11, in  
load\_entry\_point(‘ansible-container’, ‘console\_scripts’, ‘conductor’)()  
File “/\_ansible/container/init.py”, line 19, in wrapped  
return fn(\*args, \*\*kwargs)  
File “/\_ansible/container/cli.py”, line 399, in conductor\_commandline  
\*\*params)  
File “/\_ansible/container/init.py”, line 19, in wrapped  
return fn(\*args, \*\*kwargs)  
File “/\_ansible/container/core.py”, line 813, in conductorcmd\_build  
raise RuntimeError(‘Build failed.’)  
RuntimeError: Build failed.  
Exception in thread Thread-2:  
Traceback (most recent call last):  
File “/usr/lib64/python2.7/threading.py”, line 812, in \_\_bootstrap\_inner  
self.run()  
File “/usr/lib64/python2.7/threading.py”, line 765, in run  
self.\_\_target(\*self.\_\_args, \*\*self.\_\_kwargs)  
File “/usr/lib/python2.7/site-packages/container/utils/logmux.py”, line 40, in produce  
for message in iterator:  
File “/usr/lib/python2.7/site-packages/docker/api/client.py”, line 339, in \_multiplexed\_response\_stream\_helper  
header = response.raw.read(STREAM\_HEADER\_SIZE\_BYTES)  
File “/usr/lib/python2.7/site-packages/urllib3/response.py”, line 231, in read  
raise ProtocolError(‘Connection broken: %r’ % e, e)  
ProtocolError: (‘Connection broken: IncompleteRead(0 bytes read)’, IncompleteRead(0 bytes read))

2017-11-09T07:08:02.876617 Could not connect to container host. Check your docker config [container.cli] caller\_file=/usr/lib/python2.7/site-packages/container/cli.py caller\_func=call caller\_line=328

ANsible \_ Version :

Ansible Container, version 0.9.2
