Git not finding the CAFile

I’m having some trouble “getting” hugo modules with hugo mod get. I get the following error when I run the command:

WARN 2022/04/21 21:33:07 module "gitlab.com/kaushalmodi/hugo-theme-refined" not found; either add it as a Hugo Module or store it in "~/mwe/themes".: module does not exist
go get: module gitlab.com/kaushalmodi/hugo-theme-refined: git ls-remote -q origin in /tmp/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/4968d1f02cc0835e7aa4357b7bc0db3f5c9e9f741eb4e2a9a0fd4e026d7f1cd1: exit status 128:
	fatal: unable to access 'https://gitlab.com/kaushalmodi/hugo-theme-refined.git/': server certificate verification failed. CAfile: none CRLfile: none

As a minimal (not) working example I created a new site with only this in the config.toml:

[module]
  [[module.imports]]
    path = "gitlab.com/kaushalmodi/hugo-theme-refined"

I have the git option http.sslCAInfo set through environment variable (GIT_SSL_INFO), but I have also tried setting it in my git configuration to no avail.

Both running go get gitlab.com/kaushalmodi/hugo-theme-refined and running git ls-remote -q origin in the tmp directory work fine, so I suspect Hugo as the culprit.

Let’s see if an environment variable is being blocked. In your site configuration:

[security.exec]
  osEnv = ['.*']
2 Likes

Well that did the trick. Thank you for your speedy assistance!

1 Like

You’re welcome. It would be helpful if we could determine which environment variables were blocked.

The default list is:

[security.exec]
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

Would you mind trying this?

[security.exec]
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM|HOME)$']

Or this?

[security.exec]
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM|XDG_CONFIG_HOME)$']
1 Like

Both of those alternatives work for me. My XDG_CONFIG_HOME is set to $HOME/.config, so that’s probably why.

2 Likes

Thanks for the update. Much appreciated.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.