microsoft / microsoft/azure-devops-python-api
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1007)
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 684
- フォーク
- 218
- 平均マージ
- 8日 10時間
- マージ済み PR(30日)
- 1
説明
Running a pipeline on one of our ADO server I try to run the same script but it is connecting to another server
I tried using the local certificate and I tried disabling SSL check at all
Getting a connection works fine, but trying to get projects :
project_client = self.connection.clients_v7_1.get_core_client()
I always get this error
Error occurred in request., SSLError: HTTPSConnectionPool(host='**********', port=443): Max retries exceeded with url: /companyname/_apis (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1007)')))
I tried using the CA path
I tried disabling SSL at all
I tried to run the pipeline on different pools too
I am out of ideas, any help appreciated
class Ado:
def init_ssl_env(self):
if not os.path.exists(Ado.certificate_path):
return
try:
if self.verify_ssl:
# Option 1: Set CA bundle to custom certificate
os.environ['REQUESTS_CA_BUNDLE'] = Ado.certificate_path
self.logger.info(f"Enable SSL check - REQUESTS_CA_BUNDLE = {Ado.certificate_path}")
else:
# Option 2: Disable SSL verification globally (not recommended for production)
os.environ['PYTHONHTTPSVERIFY'] = '0'
self.logger.info(f"Disable SSL check - PYTHONHTTPSVERIFY = 0")
except Exception as e:
self.logger.error(f"Error setting SSL: {str(e)}")
sys.exit(1)
Here is how I get my connection:
def get_api_connection(self,url):
'''
Sets up a connection with the Azure Devops API via the Azure Devops python API
(https://github.com/microsoft/azure-devops-python-api/tree/dev)
Parameters:
org_url (string): url of the organization
Returns:
<class 'azure.devops.connection.Connection'>: connection with the Azure Devops API
'''
_url = f"https://{url}"
self.url = url
try:
credentials = BasicAuthentication('', f"{Ado.servers[url]}")
self.connection = Connection(base_url = _url, creds = credentials)
self.logger.info(f'Azure Devops Connection established successfully with {_url}.')
return True
except Exception:
self.logger.exception(f'Error setting up Azure DevOps connection with {_url}.')
return False
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
レポートで説明されている Connection(base_url, creds) エントリポイントと get_core_client() 呼び出しから始め、HTTPS 証明書の検証がどのように設定されているかを追跡します。報告されている CA 設定でプロジェクト一覧取得リクエストを再現し、検証を無効にせずに ADO サーバーに対して成功するかどうかを判断します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, python
- 領域
- api, security
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100