HttpClients.createSystem() 与 HttpClients.createDefault() 之间的区别?

Difference between HttpClients.createSystem() vs HttpClients.createDefault()?

我正在查看在 org.apache.http.impl.client.HttpClients 中创建 ClosableHttpClient 的方法,我看到了两种可能的方法:

两者有什么区别?我知道 it is possible to set up a custom client with .custom() to override certain behaviors 但是我剩下的问题是:

由于历史原因(可追溯到 200 年代早期)HttpClient 默认不考虑系统属性。

What are the defaults associated with .createDefault()?

这些是 HttpClient 开发人员选择的项目默认值

What system properties affect .createSystem()?

  • ssl.TrustManagerFactory.algorithm
  • javax.net.ssl.trustStoreType
  • javax.net.ssl.trustStore
  • javax.net.ssl.trustStore提供商
  • javax.net.ssl.trustStore密码
  • ssl.KeyManagerFactory.algorithm
  • javax.net.ssl.keyStoreType
  • javax.net.ssl.keyStore
  • javax.net.ssl.keyStore提供商
  • javax.net.ssl.keyStore密码
  • https.protocols
  • https.cipherSuites
  • http.proxyHost
  • http.proxyPort
  • https.proxyHost
  • https.proxyPort
  • http.nonProxyHosts
  • https.proxyUser
  • http.proxyUser
  • https.proxyPassword
  • http.proxyPassword
  • http.keepAlive
  • http.maxConnections
  • http.agent

Is it possible to modify the behavior of future clients that are created with .createDefault() or .createDefault()?

当然,通过HttpContext