gpt4 book ai didi

android - (1002) - 没有可用的客户端连接器支持所需的协议(protocol) : 'HTTPS'

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:16:23 25 4
gpt4 key购买 nike

我正在尝试使用 ReSTLet 在 Android 上设置 HTTPS 客户端,但出现此错误:

Internal Connector Error (1002) - No available client connector supports the required protocol: 'HTTPS'. Please add the JAR of a matching connector to your classpath. Then, register this connector helper manually.

许多消息来源说您只需要为 ssl 和依赖项添加 jar,因此我添加了以下 jars:

  • 组织.reSTLet
  • org.reSTLet.ext.ssl
    • org.jsslutils
  • org.reSTLet.ext.httpclient
    • org.apache.commons.codec_1.5
    • org.apache.commons.logging_1.1
    • org.apache.httpclient_4.1
    • org.apache.httpcore_4.1
    • org.apache.httpmime_4.1
    • org.apache.james.mime4j_0.6
    • net.jcip.annotations_1.0

ReSTLet 的 docs假设您需要为 HTTPS 添加一个外部“连接器”。根据它,HTTPS 客户端的选项是:

  1. Apache HTTP 客户端
  2. Net(JDK 自带)

我假设我同时拥有(org.apache.httpclient_4.1 和 JDK)。

错误消息提到“手动注册连接器助手”,但我不知道该怎么做。文档提到了连接器的参数。那里的一些链接已损坏,其他链接转到没有额外文本的 javadocs。 This one列出了一些参数,但所有看似可选的设置都与设置替代连接器无关。网络上的一些来源有通过“System.setProperty”设置内容的代码 fragment 。我复制粘贴了一些但没有成功。

最佳答案

此问题已在 ReSTLet 2.2 版中完全解决,其中内部 HTTP/HTTPS 连接器现在基于 HttpURLConnection,不需要额外的依赖项。它是轻量级的,不需要使用 Apache HTTP Client API。这对于 Android 版本尤其有效。

关于android - (1002) - 没有可用的客户端连接器支持所需的协议(protocol) : 'HTTPS' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17297177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com