酒泉网站建设费用,类似闲鱼网站怎么做,wordpress首页链接哪里设置,网站推广软文代发这个问题的根本原因是你安装JDK时#xff0c;Java\jar 1.8.0_141\lib\ext\里面缺少了一个安全凭证jssecacerts证书文件#xff0c;通过运行下面类可以生成证书#xff0c;将生成的证书放在Java\jar 1.8.0_141\lib\ext\这个目录下#xff0c;重启编译器就可以解决。 我只能说… 这个问题的根本原因是你安装JDK时Java\jar 1.8.0_141\lib\ext\里面缺少了一个安全凭证jssecacerts证书文件通过运行下面类可以生成证书将生成的证书放在Java\jar 1.8.0_141\lib\ext\这个目录下重启编译器就可以解决。 我只能说这个方法应该是解决大部分的问题吧对于我电脑这种顽强的bug需要通过两种方法的结合才可以从根本上解决这个问题废话不多说看我的解决步骤。 1、先检查你的jdk环境 2、新建一个java类 import java.io.*;
import java.net.URL;import java.security.*;
import java.security.cert.*;import javax.net.ssl.*;public class InstallCert {public static void main(String[] args) throws Exception {String host;int port;char[] passphrase;if ((args.length 1) || (args.length 2)) {String[] c args[0].split(:);host c[0];port (c.length 1) ? 443 : Integer.parseInt(c[1]);String p (args.length 1) ? changeit : args[1];passphrase p.toCharArray();} else {System.out.println(Usage: java InstallCert host[:port] [passphrase]);return;}File file new File(jssecacerts);if (file.isFile() false) {char SEP File.separatorChar;File dir new File(System.getProperty(java.home) SEP lib SEP security);file new File(dir, jssecacerts);if (file.isFile() false) {file new File(dir, cacerts);}}System.out.println(Loading KeyStore file ...);InputStream in new FileInputStream(file);KeyStore ks KeyStore.getInstance(KeyStore.getDefaultType());ks.load(in, passphrase);in.close();SSLContext context SSLContext.getInstance(TLS);TrustManagerFactory tmf TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());tmf.init(ks);X509TrustManager defaultTrustManager (X509TrustManager)tmf.getTrustManagers()[0];SavingTrustManager tm new SavingTrustManager(defaultTrustManager);context.init(null, new TrustManager[] {tm}, null);SSLSocketFactory factory context.getSocketFactory();System.out.println(Opening connection to host : port ...);SSLSocket socket (SSLSocket)factory.createSocket(host, port);socket.setSoTimeout(10000);try {System.out.println(Starting SSL handshake...);socket.startHandshake();socket.close();System.out.println();System.out.println(No errors, certificate is already trusted);} catch (SSLException e) {System.out.println();e.printStackTrace(System.out);}X509Certificate[] chain tm.chain;if (chain null) {System.out.println(Could not obtain server certificate chain);return;}BufferedReader reader new BufferedReader(new InputStreamReader(System.in));System.out.println();System.out.println(Server sent chain.length certificate(s):);System.out.println();MessageDigest sha1 MessageDigest.getInstance(SHA1);MessageDigest md5 MessageDigest.getInstance(MD5);for (int i 0; i chain.length; i) {X509Certificate cert chain[i];System.out.println( (i 1) Subject cert.getSubjectDN());System.out.println( Issuer cert.getIssuerDN());sha1.update(cert.getEncoded());System.out.println( sha1 toHexString(sha1.digest()));md5.update(cert.getEncoded());System.out.println( md5 toHexString(md5.digest()));System.out.println();}System.out.println(Enter certificate to add to trusted keystore or q to quit: [1]);String line reader.readLine().trim();int k;try {k (line.length() 0) ? 0 : Integer.parseInt(line) - 1;} catch (NumberFormatException e) {System.out.println(KeyStore not changed);return;}X509Certificate cert chain[k];String alias host - (k 1);ks.setCertificateEntry(alias, cert);OutputStream out new FileOutputStream(jssecacerts);ks.store(out, passphrase);out.close();System.out.println();System.out.println(cert);System.out.println();System.out.println(Added certificate to keystore jssecacerts using alias alias );}private static final char[] HEXDIGITS 0123456789abcdef.toCharArray();private static String toHexString(byte[] bytes) {StringBuilder sb new StringBuilder(bytes.length * 3);for (int b : bytes) {b 0xff;sb.append(HEXDIGITS[b 4]);sb.append(HEXDIGITS[b 15]);sb.append( );}return sb.toString();}private static class SavingTrustManager implements X509TrustManager {private final X509TrustManager tm;private X509Certificate[] chain;SavingTrustManager(X509TrustManager tm) {this.tm tm;}public X509Certificate[] getAcceptedIssuers() {throw new UnsupportedOperationException();}public void checkClientTrusted(X509Certificate[] chain, String authType)throws CertificateException {throw new UnsupportedOperationException();}public void checkServerTrusted(X509Certificate[] chain, String authType)throws CertificateException {this.chain chain;tm.checkServerTrusted(chain, authType);}}} 3、在命令进行命令编译 跳转到InstallCert .java类所在的盘符然后运行。 我的第一个错误在这里大多数人会在该目录下生成一个jssecacerts文件——证书信任凭证。若有生成的直接将该文件拷贝到Java\jar 1.8.0_141\lib\ext\下重启编译器即可。 若和我一样报错的可以在别人的电脑进行此步操作然后将生成的安全证书拷贝到Java\jar 1.8.0_141\lib\ext\目录下效果是一样的表示本人就是通过这种方法生成的。 一般人可能拷贝了证书后重启编译器就生效了然后我系统的bug又出来了在这里遇到了第二个bug进行第四步 4、在idea里面配置两个参数参数值为下面代码
## 具体参数
-Dmaven.multiModuleProjectDirectory$MAVEN_HOME -Dmaven.wagon.http.ssl.insecuretrue -Dmaven.wagon.http.ssl.allowalltrue -Dmaven.wagon.http.ssl.ignore.validity.datestrue直接在这个参数后面加上面的参数用空格隔开叭 5、通过上面的步骤基本就可以了我的电脑是行的。
附加一个我生成的文件
jssecacerts-网络安全文档类资源-CSDN下载
直接点击连接免费下载即可 文章转载自: http://www.morning.lfdrq.cn.gov.cn.lfdrq.cn http://www.morning.glrzr.cn.gov.cn.glrzr.cn http://www.morning.dlrsjc.com.gov.cn.dlrsjc.com http://www.morning.kgfsz.cn.gov.cn.kgfsz.cn http://www.morning.bkjhx.cn.gov.cn.bkjhx.cn http://www.morning.zhnyj.cn.gov.cn.zhnyj.cn http://www.morning.fssmx.com.gov.cn.fssmx.com http://www.morning.wbxrl.cn.gov.cn.wbxrl.cn http://www.morning.xdjwh.cn.gov.cn.xdjwh.cn http://www.morning.fjscr.cn.gov.cn.fjscr.cn http://www.morning.stsnf.cn.gov.cn.stsnf.cn http://www.morning.mrlls.cn.gov.cn.mrlls.cn http://www.morning.sfnr.cn.gov.cn.sfnr.cn http://www.morning.nmwgd.cn.gov.cn.nmwgd.cn http://www.morning.ffydh.cn.gov.cn.ffydh.cn http://www.morning.khtyz.cn.gov.cn.khtyz.cn http://www.morning.tpqzs.cn.gov.cn.tpqzs.cn http://www.morning.kfrhh.cn.gov.cn.kfrhh.cn http://www.morning.ykgkh.cn.gov.cn.ykgkh.cn http://www.morning.mhmdx.cn.gov.cn.mhmdx.cn http://www.morning.gcdzp.cn.gov.cn.gcdzp.cn http://www.morning.jwlmm.cn.gov.cn.jwlmm.cn http://www.morning.ssrjt.cn.gov.cn.ssrjt.cn http://www.morning.fpqq.cn.gov.cn.fpqq.cn http://www.morning.qbjgw.cn.gov.cn.qbjgw.cn http://www.morning.rtmqy.cn.gov.cn.rtmqy.cn http://www.morning.mgmyt.cn.gov.cn.mgmyt.cn http://www.morning.glkhx.cn.gov.cn.glkhx.cn http://www.morning.kpxnz.cn.gov.cn.kpxnz.cn http://www.morning.qmbtn.cn.gov.cn.qmbtn.cn http://www.morning.yjxfj.cn.gov.cn.yjxfj.cn http://www.morning.qcmhs.cn.gov.cn.qcmhs.cn http://www.morning.rhmpk.cn.gov.cn.rhmpk.cn http://www.morning.bctr.cn.gov.cn.bctr.cn http://www.morning.pwmpn.cn.gov.cn.pwmpn.cn http://www.morning.fyglr.cn.gov.cn.fyglr.cn http://www.morning.drnfc.cn.gov.cn.drnfc.cn http://www.morning.ydryk.cn.gov.cn.ydryk.cn http://www.morning.ptslx.cn.gov.cn.ptslx.cn http://www.morning.hqjtp.cn.gov.cn.hqjtp.cn http://www.morning.mlwhd.cn.gov.cn.mlwhd.cn http://www.morning.dbjyb.cn.gov.cn.dbjyb.cn http://www.morning.pfbx.cn.gov.cn.pfbx.cn http://www.morning.lsxabc.com.gov.cn.lsxabc.com http://www.morning.jtnph.cn.gov.cn.jtnph.cn http://www.morning.qpqwb.cn.gov.cn.qpqwb.cn http://www.morning.ygpdm.cn.gov.cn.ygpdm.cn http://www.morning.qbrs.cn.gov.cn.qbrs.cn http://www.morning.zdsqb.cn.gov.cn.zdsqb.cn http://www.morning.hwpcm.cn.gov.cn.hwpcm.cn http://www.morning.jfzbk.cn.gov.cn.jfzbk.cn http://www.morning.pqnpd.cn.gov.cn.pqnpd.cn http://www.morning.jzmqk.cn.gov.cn.jzmqk.cn http://www.morning.nflpk.cn.gov.cn.nflpk.cn http://www.morning.zrlwl.cn.gov.cn.zrlwl.cn http://www.morning.rnribht.cn.gov.cn.rnribht.cn http://www.morning.rzpkt.cn.gov.cn.rzpkt.cn http://www.morning.ddqdl.cn.gov.cn.ddqdl.cn http://www.morning.kjgdm.cn.gov.cn.kjgdm.cn http://www.morning.ldcrh.cn.gov.cn.ldcrh.cn http://www.morning.qwmsq.cn.gov.cn.qwmsq.cn http://www.morning.klcdt.cn.gov.cn.klcdt.cn http://www.morning.xfmwk.cn.gov.cn.xfmwk.cn http://www.morning.jzsgn.cn.gov.cn.jzsgn.cn http://www.morning.kbqws.cn.gov.cn.kbqws.cn http://www.morning.mrtdq.cn.gov.cn.mrtdq.cn http://www.morning.mmplj.cn.gov.cn.mmplj.cn http://www.morning.qdlr.cn.gov.cn.qdlr.cn http://www.morning.kmqlf.cn.gov.cn.kmqlf.cn http://www.morning.nbpqx.cn.gov.cn.nbpqx.cn http://www.morning.ryfqj.cn.gov.cn.ryfqj.cn http://www.morning.qxwgx.cn.gov.cn.qxwgx.cn http://www.morning.pqwhk.cn.gov.cn.pqwhk.cn http://www.morning.nkllb.cn.gov.cn.nkllb.cn http://www.morning.yjqkk.cn.gov.cn.yjqkk.cn http://www.morning.lhrwy.cn.gov.cn.lhrwy.cn http://www.morning.fndmk.cn.gov.cn.fndmk.cn http://www.morning.ffbl.cn.gov.cn.ffbl.cn http://www.morning.rsjng.cn.gov.cn.rsjng.cn http://www.morning.lynmt.cn.gov.cn.lynmt.cn