Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions backend/app/services/search_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def search(self, query: str, limit: int = 10, categories: Optional[List[str]] =
last_error = e
if (
url.startswith("https://")
and _env_bool("FAROS_ALLOW_INSECURE_ARXIV_SSL", True)
and _env_bool("FAROS_ALLOW_INSECURE_SSL", False)
and "CERTIFICATE_VERIFY_FAILED" in str(e)
):
try:
Expand Down Expand Up @@ -1088,8 +1088,11 @@ def search(self, query: str, limit: int = 10) -> List[SearchResult]:
with _urlopen(request, timeout=30) as resp:
raw = resp.read().decode("utf-8")
except urllib.error.URLError as e:
if "CERTIFICATE" in str(e) or "SSL" in str(e):
logger.info("DBLP: SSL cert untrusted, retrying with unverified context")
if ("CERTIFICATE" in str(e) or "SSL" in str(e)) and _env_bool("FAROS_ALLOW_INSECURE_SSL", False):
logger.warning(
"DBLP: SSL cert untrusted, retrying with unverified context. "
"Set FAROS_ALLOW_INSECURE_SSL=false to disable this fallback."
)
with _urlopen(request, timeout=30, context=_INSECURE_SSL_CONTEXT) as resp:
raw = resp.read().decode("utf-8")
else:
Expand Down