Fix SSL shenanigans with a hack to allow the user to specify the CA bundle file
This commit is contained in:
		@@ -4,6 +4,8 @@ import giteapy
 | 
			
		||||
import logging
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
import certifi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migrator:
 | 
			
		||||
	
 | 
			
		||||
@@ -101,6 +103,15 @@ class Migrator:
 | 
			
		||||
		
 | 
			
		||||
		self.__verify_ssl = b
 | 
			
		||||
	
 | 
			
		||||
	def set_ca_bundle(self, bundle_path: str):
 | 
			
		||||
		
 | 
			
		||||
		self.__logger.info("Setting certificate bundle path")
 | 
			
		||||
		
 | 
			
		||||
		# Hacky but oh well
 | 
			
		||||
		self.__logger.info(f"Old path: {certifi.where()}")
 | 
			
		||||
		certifi.core._CACERT_PATH = bundle_path
 | 
			
		||||
		self.__logger.info(f"New path: {certifi.where()}")
 | 
			
		||||
	
 | 
			
		||||
	def migrate_entire_org(
 | 
			
		||||
			self,
 | 
			
		||||
			interactive: bool = True,
 | 
			
		||||
@@ -118,6 +129,9 @@ class Migrator:
 | 
			
		||||
		api_source: giteapy.OrganizationApi
 | 
			
		||||
		api_destination: giteapy.OrganizationApi
 | 
			
		||||
		
 | 
			
		||||
		# Tattle on certify
 | 
			
		||||
		self.__logger.info(f"Certifi is currently using CA bundle: {certifi.where()}")
 | 
			
		||||
		
 | 
			
		||||
		# Grab all org repos
 | 
			
		||||
		source_repos = self._fetch_all_org_repos(org=source_org)
 | 
			
		||||
		self.__logger.info(f"Found {len(source_repos)} repos on source:")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user