Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 자바
- 백준
- 스프링부트 도커
- 스프링부트 도커 배포
- 클라이언트
- 스프링부트 도커로 배포
- Stack
- 버퍼
- 오름차순 정렬
- 알고리즘
- lv0
- index of
- 프로그래머스 문자열 정렬
- 문자열
- 백준 N과 M 자바
- SWEA
- 프로그래머스
- 스택
- Lv1
- StringTokenizer
- 이진수 변환
- 프로그래머스 풀이
- COS Pro
- Programmers
- lv2
- 삼각형의 완성조건
- 프로그래머스 자바
- Queue
- 큐
- java
Archives
- Today
- Total
mun dev
[Python] 공공데이터포털 OpenAPI 호출 에러 SSLError: HTTPSConnectionPool(host='apis.data.go.kr', port=443) 본문
이슈 해결 모음
[Python] 공공데이터포털 OpenAPI 호출 에러 SSLError: HTTPSConnectionPool(host='apis.data.go.kr', port=443)
mndev 2025. 2. 6. 10:41기존 공공데이터 API 화면에서 호출을 진행 했을 때는 수행이 잘 되다가 주피터노트북에서 호출하려고 보니 아래와 같은 에러가 발생하는 경우가 생겼다 ..
import requests
import chardet
import xml.etree.ElementTree as ET
import logging
# API 요청
url = 'https://apis.data.go.kr/1160100/service/GetFinaStatInfoService_V2/getSummFinaStat_V2'
serviceKey = ''
params = {'serviceKey': serviceKey, 'pageNo': '1', 'numOfRows': '10', 'resultType': 'xml', 'bizyear': '2024'}
response = requests.get(url, params=params)
detected_encoding = chardet.detect(response.content)['encoding']
logger.info(f"Detected Encoding: {detected_encoding}")
decoded_text = response.content.decode(detected_encoding)
SSLError: HTTPSConnectionPool(host='apis.data.go.kr', port=443)
---------------------------------------------------------------------------
SSLError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
467 try:
--> 468 self._validate_conn(conn)
469 except (SocketTimeout, BaseSSLError) as e:
18 frames
SSLError: [SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1007)
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
SSLError: [SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1007)
The above exception was the direct cause of the following exception:
MaxRetryError Traceback (most recent call last)
MaxRetryError: HTTPSConnectionPool(host='apis.data.go.kr', port=443): Max retries exceeded with url: /B552583/job/job_list_env?serviceKey= xx &pageNo=1&numOfRows=1000 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1007)')))
During handling of the above exception, another exception occurred:
SSLError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
515 if isinstance(e.reason, _SSLError):
516 # This branch is for urllib3 v1.22 and later.
--> 517 raise SSLError(e, request=request)
518
519 raise ConnectionError(e, request=request)
SSLError: HTTPSConnectionPool(host='apis.data.go.kr', port=443): Max retries exceeded with url: /B552583/job/job_list_env?serviceKey= xx &pageNo=1&numOfRows=1000 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:1007)')))
url에서 s를 빼고 호출하니 오류없이 정상적으로 실행되었다.
url = 'http://apis.data.go.kr/1160100/service/GetFinaStatInfoService_V2/getSummFinaStat_V2'