working on the FRIKKIN ssl verification issue

This commit is contained in:
mike
2026-06-09 05:25:44 -07:00
parent 25bfe8cd0a
commit b60a7a82f7
4 changed files with 24 additions and 10 deletions

View File

@@ -3,11 +3,12 @@
from domain.API import API
import certifi
import gitea
import logging
import os
import sys
import certifi
class Migrator:
@@ -74,7 +75,6 @@ class Migrator:
return repo_name
"""
def set_ca_bundle(self, bundle_path: str):
self.__logger.info("Setting certificate bundle path")
@@ -83,10 +83,13 @@ class Migrator:
self.__logger.info(f"Old path: {certifi.where()}")
certifi.core._CACERT_PATH = bundle_path
self.__logger.info(f"New path: {certifi.where()}")
self.__logger.info(f"os.environ.REQUESTS_CA_BUNDLE before: {os.environ['REQUESTS_CA_BUNDLE']}")
os.environ["REQUESTS_CA_BUNDLE"] = bundle_path
self.__logger.info(f"os.environ.REQUESTS_CA_BUNDLE after: {os.environ['REQUESTS_CA_BUNDLE']}")
# TODO: JUST TESTING
self.__verify_ssl = bundle_path
"""
def migrate_entire_org(
self,
@@ -105,8 +108,13 @@ class Migrator:
# api_source: giteapy.OrganizationApi
# api_destination: giteapy.OrganizationApi
# Tattle on certify
# Tattle on certify, then modify
self.__logger.info(f"Certifi is currently using CA bundle: {certifi.where()}")
if self.__ca_bundle is not None:
self.set_ca_bundle(
bundle_path=self.__ca_bundle
)
self.__logger.info(f"After modification, Certifi is now using CA bundle: {certifi.where()}")
# Grab all org repos
source_repos = self._fetch_all_org_repos(
@@ -382,6 +390,7 @@ class Migrator:
source_repos_failed.append(
(source_repo, e)
)
raise e
continue
self.__logger.debug(f"Migration result: {repo_new}")