Skip to content

Commit 43dc4ee

Browse files
authored
Bypass SSL verification for NOAA API requests (#136)
1 parent 53ce251 commit 43dc4ee

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/openstudio_hpxml_calibration/weather_normalization/utility_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@
44
import eeweather
55
import numpy as np
66
import pandas as pd
7+
import requests
78
import yaml
89
from lxml import objectify
910

1011
from openstudio_hpxml_calibration.hpxml import EnergyUnitType, FuelType, HpxmlDoc
1112
from openstudio_hpxml_calibration.units import convert_units
1213

14+
# To bypass SSL verification when making requests to NOAA API
15+
old_init = requests.Session.__init__
16+
17+
18+
def new_init(self, *args, **kwargs):
19+
old_init(self, *args, **kwargs)
20+
self.verify = False # Force all sessions to ignore SSL
21+
22+
23+
requests.Session.__init__ = new_init
24+
1325

1426
def read_yaml_file(config_path: str):
1527
with open(config_path) as file:

0 commit comments

Comments
 (0)