fititnt / chatops-wg-infra

ChatOps _for non-DevOps people_ Working Group 2018/01 - Infrastructure main repository
https://github.com/fititnt/chatops-wg
1 stars 0 forks source link

SSL does not work inside some containers #8

Open fititnt opened 6 years ago

fititnt commented 6 years ago

Ref: https://github.com/fititnt/chatops-wg/issues/26

Humm, our container cannot curl -v https://slack.com/api.

Rocket.chat container (do not work)

root@chatopswg:~# docker exec -it rocketchat_rocketchat_1 bash
rocketchat@e2ded707228a:/app/bundle$ curl -v https://slack.com/api
* Hostname was NOT found in DNS cache
*   Trying 45.55.32.60...
* connect to 45.55.32.60 port 1080 failed: Connection refused
* Failed to connect to rocketchat.chatopswg.xyz port 1080: Connection refused
* Closing connection 0
curl: (7) Failed to connect to rocketchat.chatopswg.xyz port 1080: Connection refused

Botman PHP (works)

root@chatopswg:~# docker ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                                                              NAMES
e2ded707228a        rocket.chat:latest      "node main.js"           7 hours ago         Up 13 minutes       3000/tcp                                                           rocketchat_rocketchat_1
999ff8eeffeb        nginx:alpine            "/bin/sh -c 'nginx..."   7 hours ago         Up 7 hours          80/tcp                                                             placeholder_nginx_1
76d8b846bbf6        traefik                 "/traefik"               7 hours ago         Up 6 hours          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp   traefik_traefik_1
1c2175750b31        node:alpine             "npm start"              12 days ago         Up 7 hours          0.0.0.0:3400->3000/tcp                                             iajsbotkit_nodejs_1
bcd79facbe0d        nanoninja/php-fpm:7.1   "docker-php-entryp..."   12 days ago         Up 7 hours          9000/tcp, 0.0.0.0:3200->3000/tcp                                   iaphpbotman_php_1
a4fd36c3be3f        nginx:alpine            "/bin/sh -c 'nginx..."   12 days ago         Up 7 hours          0.0.0.0:8200->80/tcp                                               iaphpbotman_nginx_1
7df3c7dc7ed8        mongo:3.2               "docker-entrypoint..."   13 days ago         Up About an hour    27017/tcp                                                          rocketchat_mongo_1
root@chatopswg:~# docker exec -it iaphpbotman_php_1
"docker exec" requires at least 2 argument(s).
See 'docker exec --help'.

Usage:  docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Run a command in a running container
root@chatopswg:~# curl
curl: try 'curl --help' or 'curl --manual' for more information
root@chatopswg:~# curl -v https://slack.com/api
*   Trying 54.240.190.138...
* Connected to slack.com (54.240.190.138) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: *.slack.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,ST=California,L=San Francisco,O=Slack Technologies\, Inc.,CN=*.slack.com
*    start date: Wed, 01 Feb 2017 00:00:00 GMT
*    expire date: Fri, 01 Feb 2019 23:59:59 GMT
*    issuer: C=US,O=GeoTrust Inc.,CN=GeoTrust SSL CA - G3
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET /api HTTP/1.1
> Host: slack.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=iso-8859-1
< Content-Length: 229
< Connection: keep-alive
< Date: Sun, 04 Feb 2018 00:14:54 GMT
< Location: https://api.slack.com
< Server: Apache
< X-Frame-Options: SAMEORIGIN
< X-Cache: Miss from cloudfront
< Via: 1.1 1c618ea0f595386e66803b2a07e0f4dc.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: z0GJx_5b5qIUHO9eq3Uxci2ocuFdwhfQ21TQTNj5cAA1hVuwxtobug==
< 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://api.slack.com">here</a>.</p>
</body></html>
* Connection #0 to host slack.com left intact