spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

I cannot get this to work on my work laptop

Open danieleBennetts opened this issue 1 year ago • 2 comments

I have managed to install the cert from zscaler But the kit fails at the fetch phase

logs.log

danieleBennetts avatar Sep 10 '25 13:09 danieleBennetts

Same issue here. I'm using AlmaLinux (RHEL-like) on WSL on company laptop, with zscaler proxy. Zscaler proxy is configured in HTTP_PROXY / HTTPS_PROXY environment variable, and zscaler root CA is present in "/etc/pki/tls/certs/ca-bundle.crt".

The specify install is failing at step #3 "Fetch latest release" (displayed very quickly before cleared) and fails with DEBUG Command exited with code: 1 exactly as in Daniele's log file.

To troubleshoot (and make it works), I edited ~/.cache/uv/archive-v0/Y9Z...mZJ/lib/python3.12/site-packages/specify_cli/init.py in def download_template_from_github: I forced verbose mode:

+     verbose = True

and added a "pause" before exit operations

+       print("Press Enter to continue...")
+       input()
        raise typer.Exit(1)

to read error: Error fetching release information: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

In same method, I added this code :

    # Common Linux certificate bundle locations
    cert_paths = [
        "/etc/ssl/certs/ca-certificates.crt",  # Debian/Ubuntu
        "/etc/pki/tls/certs/ca-bundle.crt",   # RHEL/CentOS
        "/etc/ssl/ca-bundle.pem",             # openSUSE
        "/etc/ssl/cert.pem",                  # Alpine Linux
    ]

    # Find the system cert bundle
    cert_file = None
    for path in cert_paths:
        if os.path.exists(path):
            cert_file = path
            break

    if cert_file:
        # Create SSL context with custom CA file
        print(f"Using cafile {cert_file}")
        context = ssl.create_default_context(cafile=cert_file)
    else:
        # Fallback to default context
        context = ssl.create_default_context()

and then added verify=context in httpx calls: Before:

response = httpx.get(api_url, timeout=30, follow_redirects=True)

After:

response = httpx.get(api_url, timeout=30, follow_redirects=True, verify=context)

and also this call:

with httpx.stream("GET", download_url, timeout=30, follow_redirects=True) as response:

after edit:

with httpx.stream("GET", download_url, timeout=30, follow_redirects=True, verify=context) as response:

Got it installed after ;)

tberta avatar Sep 11 '25 08:09 tberta

The latest version of Specify allows relying on truststore as well as bypassing TLS validation altogether. Recommend installing it and seeing if it works.

localden avatar Sep 11 '25 20:09 localden