Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:(304, 57) 错误: 不兼容的类型: SSLContext无法转换为KeyStore #4

Open
OLDdriver2 opened this issue Mar 12, 2018 · 6 comments

Comments

@OLDdriver2
Copy link

api-gateway-demo-sign-java/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtil.java 480: SSLSocketFactory ssf = new SSLSocketFactory(ctx);
ctx无法转化为KeyStore。

@YIKAILucas
Copy link

同样这个问题,请问你怎么解决的

1 similar comment
@YIKAILucas
Copy link

同样这个问题,请问你怎么解决的

@284361303
Copy link

请问有解决的吗?

@checkming
Copy link

请问有解决过的同学吗?

@JekiJake
Copy link

JekiJake commented Dec 4, 2024

+1

@JekiJake
Copy link

JekiJake commented Dec 4, 2024

换一种方法,可以不用aliyun这个,aliyun这个有问题。
private void getBarcodeData(String barcode) {
String host = "https://barcode100.market.alicloudapi.com";
String path = "/getBarcode";
String method = "GET";
String appcode = "你的appcode";
String querys = "Code=" + barcode;
String url = host + path + "?" + querys;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
        .url(url)
        .addHeader("Authorization", "APPCODE " + appcode)
        .build();

try (Response response = client.newCall(request).execute()) {
    if (response.isSuccessful()) {
        Log.d("tom_goods", "Response: " + response.body().string());

    } else {
        Log.e("tom_goods1", "Error: " + response.code());
    }
} catch (IOException e) {
    e.printStackTrace();
    Log.e("tom_goods2", "Error: " + e.getMessage());
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants