JIRA REST API์ ํจ๊ป httpie๋ฅผ ์ฌ์ฉํ๋ ค๊ณ ํฉ๋๋ค.
๋ช
๋ น์ด ์คํจํ๊ณ "SSLError: hostname
bash-3.2$ http https://jira.mongodb.org/rest/api/2/search?jql=assignee=bob
http: error: SSLError: hostname 'jira.mongodb.org' doesn't match either of '*.mongodb.com', 'mongodb.com'
๋ด ์ดํด๋ SSL ์ธ์ฆ์๊ฐ ์ ํจํ์ง ์์ ๊ฒฝ์ฐ requests
์ผ๋ฐ์ ์ผ๋ก ํด๋น ์ค๋ฅ๊ฐ ๋ฐ์ํด์ผ ํ๋ค๋ ๊ฒ์
๋๋ค. ์ด ๋ฉ์์ง๋ ์ธ์ฆ์๊ฐ *.mongodb.com์ ๋ํ ๊ฒ์์ ์์ํ๋ ๊ฒ์ผ๋ก ๋ณด์ด๋ฉฐ, jira.mongodb.org์ ํด๋นํ์ง ์์ต๋๋ค.
๊ทธ๋ฌ๋ SSL ๊ฒฝ๊ณ ์์ด ๋์ผํ ๋ช ๋ น์ด CuRL์ ํตํด ์ ๋๋ก ์๋ํฉ๋๋ค.
bash-3.2$ curl -v https://jira.mongodb.org/rest/api/2/search?jql=assignee=free
* Adding handle: conn: 0x7fbe2b003a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fbe2b003a00) send_pipe: 1, recv_pipe: 0
* About to connect() to jira.mongodb.org port 443 (#0)
* Trying 54.221.213.229...
* Connected to jira.mongodb.org (54.221.213.229) port 443 (#0)
* TLS 1.1 connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate: jira.mongodb.org
* Server certificate: Go Daddy Secure Certification Authority
* Server certificate: Go Daddy Class 2 Certification Authority
> GET /rest/api/2/search?jql=assignee=free HTTP/1.1
> User-Agent: curl/7.30.0
> Host: jira.mongodb.org
> Accept: */*
>
< HTTP/1.1 200 OK
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Vary: Accept-Encoding
< Cache-Control: no-cache, no-store, no-transform
< Content-Type: application/json;charset=UTF-8
< Date: Fri, 26 Sep 2014 02:14:22 GMT
< X-AREQUESTID: 134x54195573x2
< Transfer-Encoding: chunked
< X-AUSERNAME: anonymous
< Set-Cookie: atlassian.xsrf.token=ASGJ-NC06-6R0X-EKH7|4d65065ad638afb4fe7edb9b04e81379cc315e06|lout; Path=/
<
* Connection #0 to host jira.mongodb.org left intact
{"startAt":0,"maxResults":50,"total":0,"issues":[]}
๋ํ ๋ด ๋ธ๋ผ์ฐ์ (Chrome)์์๋ ์ ๋ก๋๋๋ฉฐ SSL ๊ฒฝ๊ณ ๊ฐ ํ์๋์ง ์์ต๋๋ค.
๋ฌด์จ ์ผ์ด ์ผ์ด๋๊ณ ์๋์ง์ ๋ํ ์๊ฒฌ์ด ์์ผ์ญ๋๊น?
์ด๊ฒ์ SNI์ ๊ด๋ จ์ด ์์ต๋๋ค. 'pip install requests[security]'๋ฅผ ์ํํ๋ฉด ์ถ๊ฐ ์ข ์์ฑ์ ์ค์นํด์ผ ํฉ๋๋ค.
K-9 Mail์ ์ฌ์ฉํ์ฌ Android ๊ธฐ๊ธฐ์์ ๋ณด๋์ต๋๋ค. ์ ๊ฐ๋ตํ ์ค๋ช ์ ๋ถํ๋๋ฆฝ๋๋ค.
๋์ผํ ๋ฌธ์ ๊ฐ ์์ง๋ง ์์ ์์ฒญ์ ๋ฐ์ ์ ์๋ ์ ์ผํ ๋ฐฉ๋ฒ์ ํ์ธ์ False๋ก ์ค์ ํ๋ ๊ฒ์ ๋๋ค. ์์ฒญ์ ์ ๊ทธ๋ ์ด๋ํ๊ณ ์์ฒญ[๋ณด์]์ ์ค์นํ๊ณ ํ์ธ์ ์ธ์ฆ์ ํ์ผ๋ก ์ค์ ํ๋ ค๊ณ ์๋ํ์ต๋๋ค.
๋๋์ด ๋ฌธ์ ๊ฐ ์์๋ค. requests[security]
๋ฐ httpie
๋ฅผ ์
๊ทธ๋ ์ด๋ํด์ผ ํ์ต๋๋ค.
pip install --upgrade requests[security]
pip install --upgrade httpie
์ด๋ฌํ ์ค๋ฅ๋ Python 3.6+์ ์์กดํ๋ ์ต์ HTTPie ๋ฒ์ ์์ ์ฌ๋ผ์ ธ์ผ ํฉ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๊ฒ์ SNI์ ๊ด๋ จ์ด ์์ต๋๋ค. 'pip install requests[security]'๋ฅผ ์ํํ๋ฉด ์ถ๊ฐ ์ข ์์ฑ์ ์ค์นํด์ผ ํฉ๋๋ค.
K-9 Mail์ ์ฌ์ฉํ์ฌ Android ๊ธฐ๊ธฐ์์ ๋ณด๋์ต๋๋ค. ์ ๊ฐ๋ตํ ์ค๋ช ์ ๋ถํ๋๋ฆฝ๋๋ค.