Buggy code:
private ArrayList < Integer > processingTimes = new ArrayList < Integer > ( ) ; private ArrayList < Integer > responseTimes = new ArrayList < Integer > ( ) ; private int maxLinkLimitLogCounter = 0 ; protected ProjectManager projectManager ; protected URLManager urlManager ; private ProjectSummaryManager projectSummaryManager ; protected Project project ; protected ProjectSummary summary ; private ThreadPoolTaskExecutor taskExecutor ; protected static final Logger logger = Logger . getLogger ( ProjectJobWorker . class . getName ( ) ) ; protected String thisUserAgent = "" ; private DefaultHttpClient httpClient ; protected URLChecker urlChecker = null ; private MD5Calc hashTool = new MD5Calc ( "SHA-1" ) ; private String basicAuthHeader = "" ; private String cookieHeader = "" ; private ArrayList < KeywordStem > keywords = new ArrayList < KeywordStem > ( ) ; private ArrayList < KeywordStem > rootKeywords = new ArrayList < KeywordStem > ( ) ; private InetAddress [ ] resolvedInet ; @ Autowired BotConfig config ; public void checkAndStartInactiveProject ( ) { } private void stopDeactivateAndSaveProject ( ArrayList < Integer > warnMessages ) { } private boolean finalizeProject ( ArrayList < Integer > warnMessages ) { } private int recalculateCrawlingSpeed ( boolean rapidCrawling , int lastThreadSetting ) { } protected boolean checkIfProjectAvailableToStart ( List < Project > projectsToProcess , boolean isExplorativProject ) { } protected void releaseHttpClientResources ( ) { } public void initHttpClient ( ) throws Exception { DnsResolver dnsResolver = null ; if ( ( ( config . PROXYHOST ) != null ) && ( ( config . PROXYHOST . length ( ) ) <= 0 ) ) { try { SystemDefaultDnsResolver r = new SystemDefaultDnsResolver ( ) ; resolvedInet = r . resolve ( project . getRootDomainToCrawlWithoutProtocol ( ) ) ; } catch ( Exception e ) { ArrayList < Integer > msg = new ArrayList < Integer > ( ) ; msg . add ( COULDNOTRESOLVEHOSTNAME . getInfoMessageCode ( ) ) ; project . setInfoMessageCodes ( msg ) ; project . setErrorCount ( 1 ) ; project . setActive ( false ) ; project . setDisabledByError ( true ) ; projectManager . saveOrUpdateProject ( project ) ; return ; } dnsResolver = new SystemDefaultDnsResolver ( ) { @ Override public InetAddress [ ] resolve ( final String host ) throws UnknownHostException { if ( host . equalsIgnoreCase ( project . getRootDomainToCrawlWithoutProtocol ( ) ) ) { return resolvedInet ; } else { return super . resolve ( host ) ; } } } ; } SSLContext sslContext = SSLContext . getInstance ( "SSL" ) ; sslContext . init ( null , new TrustManager [ ] { new X509TrustManager ( ) { public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } public void checkServerTrusted ( X509Certificate [ ] arg0 , String arg1 ) throws CertificateException { } public void checkClientTrusted ( X509Certificate [ ] arg0 , String arg1 ) throws CertificateException { } } } , new SecureRandom ( ) ) ; <START_BUG> SSLSocketFactory sf = new SSLSocketFactory ( sslContext ) ; <END_BUG> SchemeRegistry schemeRegistry = new SchemeRegistry ( ) ; schemeRegistry . register ( new org . apache . http . conn . scheme . Scheme ( "http" , 80 , PlainSocketFactory . getSocketFactory ( ) ) ) ; schemeRegistry . register ( new org . apache . http . conn . scheme . Scheme ( "https" , 443 , sf ) ) ; PoolingClientConnectionManager cm ; if ( ( ( config . PROXYHOST ) != null ) && ( ( config . PROXYHOST . length ( ) ) <= 0 ) ) { cm = new PoolingClientConnectionManager ( schemeRegistry , dnsResolver ) ; } else { cm = new PoolingClientConnectionManager ( schemeRegistry ) ; } cm . setMaxTotal ( 30 ) ; cm . setDefaultMaxPerRoute ( 15 ) ; this . httpClient = new DefaultHttpClient ( cm ) ; if ( ( ( config . PROXYHOST ) != null ) && ( ( config . PROXYHOST . length ( ) ) > 0 ) ) { HttpHost proxy = new HttpHost ( config . PROXYHOST , Integer . parseInt ( config . PROXYPORT ) ) ; httpClient . getParams ( ) . setParameter ( DEFAULT_PROXY , proxy ) ; if ( ( ( config . PROXYNTLMDOMAIN ) != null ) && ( ( config . PROXYNTLMDOMAIN . length ( ) ) > 0 ) ) { NTCredentials creds = new NTCredentials ( config . PROXYUSER , config . PROXYPASSWORD , config . PROXYNTLMWWORSTATION , config . PROXYNTLMDOMAIN ) ; httpClient . getCredentialsProvider ( ) . setCredentials ( ANY , creds ) ; } else if ( ( ( config . PROXYUSER ) != null ) && ( ( config . PROXYUSER . length ( ) ) > 0 ) ) { httpClient . getCredentialsProvider ( ) . setCredentials ( new org . apache . http . auth . AuthScope ( config . PROXYHOST , Integer . parseInt ( config . PROXYPORT ) ) , new org . apache . http . auth . UsernamePasswordCredentials ( config . PROXYUSER , config . PROXYPASSWORD ) ) ; } } httpClient . getParams ( ) . setParameter ( COOKIE_POLICY , IGNORE_COOKIES ) ; httpClient . getParams ( ) . setParameter ( CONNECTION_TIMEOUT , 5000 ) ; httpClient . getParams ( ) . setParameter ( SO_TIMEOUT , 10000 ) ; httpClient . getParams ( ) . setParameter ( HANDLE_REDIRECTS , false ) ; httpClient . getParams ( ) . setParameter ( "http.protocol.content-charset" , "UTF-8" ) ; UserManager userManager = ( ( UserManager ) ( AppContext . getApplicationContext ( ) . getBean ( "UserManager" ) ) ) ; setDiscoverLimit ( project . getDiscoverLimit ( ) ) ; setCookieHeader ( ( ( ( getProject ( ) . getCookieName ( ) ) + "=" ) + ( getProject ( ) . getCookieValue ( ) ) ) ) ;

Fix:
SSLSocketFactory sf = new SSLSocketFactory ( sslContext , SSLSocketFactory . ALLOW_ALL_HOSTNAME_VERIFIER ) ;