gang_qi_xi_2 2020-07-07 11:17 采纳率: 80%
浏览 1429
已采纳

代码运行报"errcode":43003,"errmsg":"require https hints: [EfAd244ce-SFCF8!]"}错误,该如何解决?

错误如下:

[20-7-2 11:10:35:916 CST] 00000028 SystemOut O trytrytrytrytrytrytrytrytrytry

[20-7-2 11:10:35:916 CST] 00000028 SystemOut O 1111111111111111

[20-7-2 11:10:35:916 CST] 00000028 SystemOut O urlStr--http://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx59fcee41cd6332a2&secret=e2c516dc7003cc6c0bbfee3ebbc18e98

[20-7-2 11:10:35:958 CST] 00000028 SystemOut O str---{"errcode":43003,"errmsg":"require https hints: [EfAd244ce-SFCF8!]"}

[20-7-2 11:10:35:958 CST] 00000028 SystemOut O str3---errmsg

[20-7-2 11:10:35:958 CST] 00000028 SystemOut O accesstoken---errmsg

部分代码如下:

System.out.println("trytrytrytrytrytrytrytrytrytry");

String jsonstring = "";

String jsonstringnew="";

 System.out.println("1111111111111111");
 String urlStr="http://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=xxxxxx&secret=xxxxxxxx";
 //String urlStr="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=zzzzzzz&secret=zzzzzzz";
 System.out.println("urlStr--"+urlStr);
 URL url;
 url = new URL(urlStr);
 URLConnection urlConnection=url.openConnection();
 InputStream in=urlConnection.getInputStream();
 InputStreamReader read=new InputStreamReader(in,Charset.forName("UTF-8"));
 BufferedReader bread=new BufferedReader(read);
 String str1=null;
 StringBuffer strb=new StringBuffer();
 if(null!=(str1=bread.readLine())){
  strb.append(str1);
 }
 bread.close();
 read.close();
 in.close();
 String str=strb.toString();

 System.out.println("str---"+str);
  String[] ss = str.split("\"");
  String str3 = ss[3];
  System.out.println("str3---"+str3);
 String accesstoken=str3;
 System.out.println("accesstoken---"+accesstoken);
 String urlStr1="https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token="+accesstoken;
 URL url1=new URL(urlStr1);
 URLConnection urlConnection1=url1.openConnection();
 InputStream in1=urlConnection1.getInputStream();
 InputStreamReader read1=new InputStreamReader(in1,Charset.forName("UTF-8"));
 BufferedReader bread1=new BufferedReader(read1);
 String str2=null;
 StringBuffer strb1=new StringBuffer();
 if(null!=(str2=bread1.readLine())){
  strb1.append(str2);
 }
 bread.close();
 read.close();
 in.close();
 String str34=strb1.toString();
  • 写回答

5条回答 默认 最新

查看更多回答(4条)

报告相同问题?

问题事件

  • 已采纳回答 12月16日

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突