I am trying to write a server logic which takes 'https' request but client does not have any certificate, how do I write it?
2条回答 默认 最新
- duanhe1903 2017-01-31 17:33关注
This could go two different directions depending on what you're actually asking.
If you're asking how to host
https
requests without the server having a certificate, that's impossible.https
requests mean that the connection is secured by SSL/TLS, which necessarily requires a server certificate to function.If you're asking how to host
https
requests without requiring clients to have certificates, that's another matter, and in fact is the default behavior of thehttp.Server
. You actually have to set thehttps.Server
fieldClientAuth
(for example, tohttp.RequireAndVerifyClientCert
) in order to actually require those certs. If you don't set this field, the default value ishttp.NoClientCert
, which allows client connections without certificates, and doesn't validate the certs even if they are presented.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报