jAgent 是否支持 https 端点?

时间:2021-01-28 01:00:36

标签: api jbase

我们目前在 jAgent 上有一些 API 端点。这些都是Http的。我正在从我的 Angular 应用程序调用这些 API 以与 jBase 后端进行通信。我们刚刚使用自签名证书在 Https 上托管了 Angular 应用程序,结果发现 API 调用失败并显示错误消息,“'https://*' 上的页面已通过 HTTPS 加载,但请求了不安全的 XMLHttpRequest 端点“http://”。此请求已被阻止;内容必须通过 HTTPS 提供。"

有没有办法在 jAgent https 上建立端点,以便我们可以解决这个问题?

1 个答案:

答案 0 :(得分:1)

您确实可以将 jAgent 配置为使用 SSL,以便您可以通过 HTTPS 处理请求。此处有太多内容无法完整复制/粘贴,但简而言之,请参阅 jAgent Administration: jAgent Configuration File 并注意以下评论:

; For SSL connections, specify the path of the x509 certificate to
; use. When a certificate is specified, a private key must also be
; specified. This option duplicates the -c (--certificate) command
; line option.
;certificate = <path to certificate (.pem) file>

; For SSL connections, specify the path of the private key for the
; certificate being used. This option duplicates the -k (--private_key)
; command line option.
;private_key = <path to private key (.pem) file>

此外,请参阅 jAgent Security 以了解更多上下文。可以在运行 jAgent 时通过命令行参数指定证书和密钥,或者(推荐)在配置中设置并注意指定配置。此命令说明了两者:

jbase_agent -c cert.pem -k key.pem --config %HOME%\jagent_config