Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring NIX_SSL_CERT_FILE for self-hosted Linux runners when needed #136

Open
vroad opened this issue Apr 15, 2022 · 1 comment
Open

Comments

@vroad
Copy link

vroad commented Apr 15, 2022

I set up my self-hosted runner on AWS with philips-labs/terraform-aws-github-runner, and found that python programs fails to fetch from HTTPS URLs without environment variable NIX_SSL_CERT_FILE. Only occured with Amazon Linux 2 AMIs, with Ubuntu AMIs this action just worked fine.

Can we somehow detect this situation and automatically set this environment variable? Currenly, the action only sets the variable on macOS runners.

if [[ $OSTYPE =~ darwin ]]; then
# macOS needs certificates hints
cert_file=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
echo "NIX_SSL_CERT_FILE=$cert_file" >> "$GITHUB_ENV"
export NIX_SSL_CERT_FILE=$cert_file
sudo launchctl setenv NIX_SSL_CERT_FILE "$cert_file"
fi

@amarshall
Copy link

Possibly related: #145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants