I'm working on https://github.com/NorseGaud/go-daemon and I'm not able to run http GET calls inside of the child processes. I don't know enough about golang and os.Process.
I'm using macOS.
When I run "go run examples/cmd/gd-signal-handling/signal-handling.go", which is just doing a simple httpClient.Do
in the child, I see:
2024/04/05 17:45:33 - - - - - - - - - - - - - - -
2024/04/05 17:45:33 daemon started
1
2024/04/05 17:45:34 error making GET request to google.com err Get "https://google.com": tls: failed to verify certificate: SecPolicyCreateSSL error: 0
Yet it works if I run the same httpClient.Do
in the main func.
I then quit the process with "go run examples/cmd/gd-signal-handling/signal-handling.go -s quit".
Would someone familiar with both golang and processes be able to explain to me why this isn't possible?
Thank you for your confirmation, @NorseGuard.
I found the issue similar with yours here. https://github.com/golang/go/issues/61000
It seems this problem is reproduced when using the relative path only at MacOS and has not been solved completely by Apple.