Golang httpClient CA certificates default location?












0















I have a go program that connects to an internal API using the httpClient (it's all generated by swagger-codegen).



The internal API is using https and internal certificates with our internal CA.



On my Windows laptop, it works fine without specifying any CA.



On a Linux server, it fails with a x509: certificate signed by unknown authority error.



I believe our Windows corporate laptops have CA installed by default, and that golang is able to get those CA without any config.



Hence i would like to know where is go checking for CAs on both Linux and Windows, so i could compare the setup between both OSes and install the correct CA on Linux.










share|improve this question


















  • 1





    Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

    – Mukesh Sharma
    Nov 23 '18 at 9:57













  • Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

    – Gauthier
    Nov 23 '18 at 10:00






  • 1





    Possible duplicate of Where is Golang picking up root CAs from?

    – Mukesh Sharma
    Nov 23 '18 at 10:02











  • yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

    – Gauthier
    Nov 23 '18 at 10:05
















0















I have a go program that connects to an internal API using the httpClient (it's all generated by swagger-codegen).



The internal API is using https and internal certificates with our internal CA.



On my Windows laptop, it works fine without specifying any CA.



On a Linux server, it fails with a x509: certificate signed by unknown authority error.



I believe our Windows corporate laptops have CA installed by default, and that golang is able to get those CA without any config.



Hence i would like to know where is go checking for CAs on both Linux and Windows, so i could compare the setup between both OSes and install the correct CA on Linux.










share|improve this question


















  • 1





    Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

    – Mukesh Sharma
    Nov 23 '18 at 9:57













  • Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

    – Gauthier
    Nov 23 '18 at 10:00






  • 1





    Possible duplicate of Where is Golang picking up root CAs from?

    – Mukesh Sharma
    Nov 23 '18 at 10:02











  • yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

    – Gauthier
    Nov 23 '18 at 10:05














0












0








0








I have a go program that connects to an internal API using the httpClient (it's all generated by swagger-codegen).



The internal API is using https and internal certificates with our internal CA.



On my Windows laptop, it works fine without specifying any CA.



On a Linux server, it fails with a x509: certificate signed by unknown authority error.



I believe our Windows corporate laptops have CA installed by default, and that golang is able to get those CA without any config.



Hence i would like to know where is go checking for CAs on both Linux and Windows, so i could compare the setup between both OSes and install the correct CA on Linux.










share|improve this question














I have a go program that connects to an internal API using the httpClient (it's all generated by swagger-codegen).



The internal API is using https and internal certificates with our internal CA.



On my Windows laptop, it works fine without specifying any CA.



On a Linux server, it fails with a x509: certificate signed by unknown authority error.



I believe our Windows corporate laptops have CA installed by default, and that golang is able to get those CA without any config.



Hence i would like to know where is go checking for CAs on both Linux and Windows, so i could compare the setup between both OSes and install the correct CA on Linux.







windows ssl go ca






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 '18 at 9:36









GauthierGauthier

2,3271922




2,3271922








  • 1





    Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

    – Mukesh Sharma
    Nov 23 '18 at 9:57













  • Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

    – Gauthier
    Nov 23 '18 at 10:00






  • 1





    Possible duplicate of Where is Golang picking up root CAs from?

    – Mukesh Sharma
    Nov 23 '18 at 10:02











  • yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

    – Gauthier
    Nov 23 '18 at 10:05














  • 1





    Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

    – Mukesh Sharma
    Nov 23 '18 at 9:57













  • Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

    – Gauthier
    Nov 23 '18 at 10:00






  • 1





    Possible duplicate of Where is Golang picking up root CAs from?

    – Mukesh Sharma
    Nov 23 '18 at 10:02











  • yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

    – Gauthier
    Nov 23 '18 at 10:05








1




1





Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

– Mukesh Sharma
Nov 23 '18 at 9:57







Linux certs locations are defined here golang.org/src/crypto/x509/root_linux.go

– Mukesh Sharma
Nov 23 '18 at 9:57















Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

– Gauthier
Nov 23 '18 at 10:00





Thanks, i found this in another answer, and the ones for Windows here: golang.org/src/crypto/x509/root_windows.go

– Gauthier
Nov 23 '18 at 10:00




1




1





Possible duplicate of Where is Golang picking up root CAs from?

– Mukesh Sharma
Nov 23 '18 at 10:02





Possible duplicate of Where is Golang picking up root CAs from?

– Mukesh Sharma
Nov 23 '18 at 10:02













yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

– Gauthier
Nov 23 '18 at 10:05





yes, as stated in the answer, but it's only for Linux whereas i was also asking for Windows

– Gauthier
Nov 23 '18 at 10:05












1 Answer
1






active

oldest

votes


















0














For Windows: https://golang.org/src/crypto/x509/root_windows.go



For Linux: https://golang.org/src/crypto/x509/root_linux.go



Found via this SO answer.






share|improve this answer


























  • at least make the URLs as links

    – Kyslik
    Nov 23 '18 at 20:36












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444015%2fgolang-httpclient-ca-certificates-default-location%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














For Windows: https://golang.org/src/crypto/x509/root_windows.go



For Linux: https://golang.org/src/crypto/x509/root_linux.go



Found via this SO answer.






share|improve this answer


























  • at least make the URLs as links

    – Kyslik
    Nov 23 '18 at 20:36
















0














For Windows: https://golang.org/src/crypto/x509/root_windows.go



For Linux: https://golang.org/src/crypto/x509/root_linux.go



Found via this SO answer.






share|improve this answer


























  • at least make the URLs as links

    – Kyslik
    Nov 23 '18 at 20:36














0












0








0







For Windows: https://golang.org/src/crypto/x509/root_windows.go



For Linux: https://golang.org/src/crypto/x509/root_linux.go



Found via this SO answer.






share|improve this answer















For Windows: https://golang.org/src/crypto/x509/root_windows.go



For Linux: https://golang.org/src/crypto/x509/root_linux.go



Found via this SO answer.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 24 '18 at 9:45

























answered Nov 23 '18 at 10:01









GauthierGauthier

2,3271922




2,3271922













  • at least make the URLs as links

    – Kyslik
    Nov 23 '18 at 20:36



















  • at least make the URLs as links

    – Kyslik
    Nov 23 '18 at 20:36

















at least make the URLs as links

– Kyslik
Nov 23 '18 at 20:36





at least make the URLs as links

– Kyslik
Nov 23 '18 at 20:36




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444015%2fgolang-httpclient-ca-certificates-default-location%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

RAC Tourist Trophy