comparison src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 414:bb278ccf9866

Pull changes from smartgit3 branch
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 21 Mar 2012 20:51:12 +0100
parents 2747b0723867 30922c728341
children 9c9c442b5f2e
comparison
equal deleted inserted replaced
413:7f27122011c3 414:bb278ccf9866
64 public class HgRemoteRepository { 64 public class HgRemoteRepository {
65 65
66 private final URL url; 66 private final URL url;
67 private final SSLContext sslContext; 67 private final SSLContext sslContext;
68 private final String authInfo; 68 private final String authInfo;
69 private final boolean debug = Boolean.parseBoolean(System.getProperty("hg4j.remote.debug")); 69 private final boolean debug;
70 private HgLookup lookupHelper; 70 private HgLookup lookupHelper;
71 private final SessionContext sessionContext; 71 private final SessionContext sessionContext;
72 72
73 HgRemoteRepository(SessionContext ctx, URL url) throws HgBadArgumentException { 73 HgRemoteRepository(SessionContext ctx, URL url) throws HgBadArgumentException {
74 if (url == null || ctx == null) { 74 if (url == null || ctx == null) {
75 throw new IllegalArgumentException(); 75 throw new IllegalArgumentException();
76 } 76 }
77 this.url = url; 77 this.url = url;
78 sessionContext = ctx; 78 sessionContext = ctx;
79 Object debugProp = ctx.getProperty("hg4j.remote.debug", false);
80 debug = debugProp instanceof Boolean ? ((Boolean) debugProp).booleanValue() : Boolean.parseBoolean(String.valueOf(debugProp));
79 if ("https".equals(url.getProtocol())) { 81 if ("https".equals(url.getProtocol())) {
80 try { 82 try {
81 sslContext = SSLContext.getInstance("SSL"); 83 sslContext = SSLContext.getInstance("SSL");
82 class TrustEveryone implements X509TrustManager { 84 class TrustEveryone implements X509TrustManager {
83 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { 85 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {