简体   繁体   English

如何从 HTTPS 请求中获取证书?

[英]How can I get Certificate from HTTPS request?

I am working with Google Assistant / Dialogflow.我正在使用 Google Assistant / Dialogflow。 I want to check all incoming requests.我想检查所有传入的请求。 I need to get and verify a certificate.我需要获取并验证证书。 I try to get a certificate from a header or param from HttpRequestServlet but nothing to get.我尝试从 header 获取证书或从 HttpRequestServlet 获取参数,但一无所获。 How can I do this?我怎样才能做到这一点?

I'm assuming that you want to validate incoming Dialogflow requests in your Java webhook server.我假设您想在 Java webhook 服务器中验证传入的 Dialogflow 请求。

Take a look at this.看看这个。 You should use Mutual TLS authentication:您应该使用相互 TLS 身份验证:

To request mTLS:要请求 mTLS:

  • Prepare your webhook HTTPS server to request the client certificate during the TLS handshake.准备您的 webhook HTTPS 服务器以在 TLS 握手期间请求客户端证书。
  • Your webhook server should verify the client certificate upon receiving it.您的 webhook 服务器应在收到客户端证书时对其进行验证。
  • Install a certificate chain for your webhook server, which can be mutually trusted by both client and server.为您的 webhook 服务器安装一个证书链,它可以被客户端和服务器相互信任。 You should use Google Trust Services CA 1O1 (GTS CA 1O1).您应该使用 Google Trust Services CA 1O1 (GTS CA 1O1)。 GTS CA 1O1 uses the GlobalSign R2 root (GS Root R2), which is owned and controlled by Google Trust Services. GTS CA 1O1 使用由 Google Trust Services 拥有和控制的 GlobalSign R2 根 (GS Root R2)。 You can download it from: https://pki.goog/repository/您可以从以下网址下载: https://pki.goog/repository/

The documentation also provides a demo about how to do this on NodeJS server .该文档还提供了有关如何在 NodeJS 服务器上执行此操作的演示 In Java, it depends on what you're using but the process is the same.在 Java 中,这取决于您使用的是什么,但过程是相同的。 So take a look a these links about setting up mTLS on Java servers and you can use the NodeJS server demo as reference.因此,请查看这些关于在 Java 服务器上设置 mTLS 的链接,您可以使用 NodeJS 服务器演示作为参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行 aws iam upload-server-certificate 时如何解决“请求中包含的安全令牌无效”错误? - How can I resolve the error "The security token included in the request is invalid" when running aws iam upload-server-certificate? 如何从私有 VPC 中的 lambda function 发出 https 请求? - How to make https request from a lambda function which is in a private VPC? 如何使用 git 将 URL 获取到我当前分支的合并请求或拉取请求? - How can I get the URL to a merge request or a pull request of my current branch using git? 如何禁用特定 http 请求的证书验证? - How to disable certificate validation for particular http request? 如何在 AWS Certificate Manager 中验证 SSL 请求 - How to validate SSL request in AWS Certificate Manager 如何获得 Google 管理的证书(入口)? 我没有收到“ManagedCertificate”的匹配项 - How to get a Google managed certificate (ingress)? I received no matches for "ManagedCertificate" 如何从 mac 上的程序集中获取对标准输入的引用? - How can I get a reference to standard input from assembly on a mac? 如何从 Firestore 文档获取更新? ReactJS - How can I get updates from a Firestore document? ReactJS AWS 将 https 证书放在哪里 - AWS Where to put the https certificate 我应该如何将 HTTPS 请求发送到 AWS 中的第三方 api - How should I send HTTPS request to a third-party api in AWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM