static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    ourSSLProtocolsExplicitlySet = System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) != null;
  }
Example #2
0
  static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    // Alexander Kitaev says it is default value (SSLv3) - since 8254
    if (!SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.7")
        && System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) == null) {
      System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "SSLv3");
    }
  }
 public void refreshSSLProperty() {
   if (ourSSLProtocolsExplicitlySet) return;
   if (SvnConfiguration.SSLProtocols.all.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.clearProperty(SVNKIT_HTTP_SSL_PROTOCOLS);
   } else if (SvnConfiguration.SSLProtocols.sslv3.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "SSLv3");
   } else if (SvnConfiguration.SSLProtocols.tlsv1.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "TLSv1");
   }
 }
 private void createPool() {
   if (myPool != null) return;
   final String property = System.getProperty(KEEP_CONNECTIONS_KEY);
   final boolean keep;
   boolean unitTestMode = ApplicationManager.getApplication().isUnitTestMode();
   // pool variant by default
   if (StringUtil.isEmptyOrSpaces(property) || unitTestMode) {
     keep = !unitTestMode; // default
   } else {
     keep = Boolean.getBoolean(KEEP_CONNECTIONS_KEY);
   }
   myPool =
       new SvnIdeaRepositoryPoolManager(
           false,
           myConfiguration.getAuthenticationManager(this),
           myConfiguration.getOptions(myProject));
 }
 @Override
 public void log(final SVNLogType logType, final Throwable th, final Level logLevel) {
   if (th instanceof SSLHandshakeException) {
     final long time = System.currentTimeMillis();
     if ((time - myPreviousTime) > ourMaxFrequency) {
       myPreviousTime = time;
       String info = myHelper.getAddInfo();
       info = info == null ? "" : " (" + info + ") ";
       if (th.getCause() instanceof CertificateException) {
         PopupUtil.showBalloonForActiveComponent(
             "Subversion: " + info + th.getCause().getMessage(), MessageType.ERROR);
       } else {
         final String postMessage =
             "\nPlease check Subversion SSL settings (Settings | Version Control | Subversion | Network)";
         PopupUtil.showBalloonForActiveComponent(
             "Subversion: " + info + th.getMessage() + postMessage, MessageType.ERROR);
       }
     }
   }
   if (shouldLog(logType)) {
     myLog.info(th);
   }
 }