ssl - Ring 是否请求 { :scheme :https} guarantee a HTTPS connection?

标签 ssl https clojure ring

如果Ring request map key :scheme的值为:https,是否保证HTTPS连接已经建立,没有证书错误?

最佳答案

这个问题可能与您使用的任何 servlet 容器有关,而不是与 ring 有关。

ring-servlet 通过 getting a value from the HttpServletRequest 填充 :scheme 键:

:scheme(关键字(.getScheme 请求))

servlet 规范对 getScheme 只有这样说:

Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

有趣的是,ring-servlet 不会对 servlet 请求调用 isSecure 方法。所以我认为你的问题应该是:

“当使用 时,ServletRequest 上的 getScheme() 是否有可能在 isSecure() 返回 false 时返回“https”?”

关于ssl - Ring 是否请求 { :scheme :https} guarantee a HTTPS connection?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26140811/

相关文章:

javascript - 我们可以在 HTTPS 和 HTTP 站点之间进行 GET 吗?

clojure - 使用 ring/compojure 连接到 clojure nREPL 的问题

rest - 如何通过 API 验证 HTTP 请求是否安全?

php - 在 htaccess 文件中为 SSL 连接重写链接

java - 是否可以通过 HTTPS 与 WebHDFS 进行加密安全通信?

node.js - 如何在 Express.js 中强制使用 SSL/https

Java 不信任 Windows 上的任何 SSL 证书

c# - 没有 SslStream 的 SSL 因为我想通过 SOCKS5 代理连接

clojure - 为什么 clojure 允许小于 (<) 或大于 (>) 运算符/函数的单个参数

clojure - 如何在 map 内创建 map ?