title: Long delay, followed by SSL Error making first SQL Server call in Java/Tomcat web application
body: <p>I have a web application that runs using Java 8 on Tomcat 8 on Windows.  When first starting the Tomcat service, the WAR unpacks and deploys as expected, but then, making the first call to the service, which makes a database connection to Microsoft SQL Server takes almost an hour to complete, then fails with a bunch of com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL errors.  The catalina.log is below.  </p>
  
  <p>Any ideas what I can do or check?  I have tried a bunch of changes to the java.security file as suggested in other posts, but nothing has worked.</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <blockquote>
    <p>27-Jan-2016 10:53:52.966 INFO [main]
    org.apache.catalina.startup.Catalina.start Server startup in 208547 ms
    27-Jan-2016 11:50:57.371 INFO [http-apr-8080-exec-6]
    com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL java.security path:
    C:\Java\jre8\lib\security Security providers: [SUN version 1.8,
    SunRsaSign version 1.8, SunEC version 1.8, SunJSSE version 1.8, SunJCE
    version 1.8, SunJGSS version 1.8, SunSASL version 1.8, XMLDSig version
    1.8, SunPCSC version 1.8, SunMSCAPI version 1.8] SSLContext provider info: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories,
    SSLv3/TLSv1/TLSv1.1/TLSv1.2) SSLContext provider services: [SunJSSE:
    KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory   aliases:
    [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator<br>
    aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA<br>
    aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2] , SunJSSE:
    Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA<br>
    aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4] , SunJSSE:
    Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA<br>
    aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5,
    1.3.14.3.2.29, OID.1.3.14.3.2.29] , SunJSSE: Signature.MD5andSHA1withRSA -> sun.security.ssl.RSASignature ,
    SunJSSE: KeyManagerFactory.SunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$SunX509 , SunJSSE:
    KeyManagerFactory.NewSunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$X509   aliases: [PKIX] ,
    SunJSSE: TrustManagerFactory.SunX509 ->
    sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory , SunJSSE:
    TrustManagerFactory.PKIX ->
    sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory   aliases:
    [SunPKIX, X509, X.509] , SunJSSE: SSLContext.TLSv1 ->
    sun.security.ssl.SSLContextImpl$TLS10Context   aliases: [SSLv3] ,
    SunJSSE: SSLContext.TLSv1.1 ->
    sun.security.ssl.SSLContextImpl$TLS11Context , SunJSSE:
    SSLContext.TLSv1.2 -> sun.security.ssl.SSLContextImpl$TLS12Context ,
    SunJSSE: SSLContext.TLS -> sun.security.ssl.SSLContextImpl$TLSContext 
    aliases: [SSL] , SunJSSE: SSLContext.Default ->
    sun.security.ssl.SSLContextImpl$DefaultSSLContext , SunJSSE:
    KeyStore.PKCS12 -> sun.security.pkcs12.PKCS12KeyStore ] java.ext.dirs:
    C:\Java\jre8\lib\ext;C:\Windows\Sun\Java\lib\ext 27-Jan-2016
    11:50:57.371 INFO [http-apr-8080-exec-35]
    com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL java.security path:
    C:\Java\jre8\lib\security Security providers: [SUN version 1.8,
    SunRsaSign version 1.8, SunEC version 1.8, SunJSSE version 1.8, SunJCE
    version 1.8, SunJGSS version 1.8, SunSASL version 1.8, XMLDSig version
    1.8, SunPCSC version 1.8, SunMSCAPI version 1.8] SSLContext provider info: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories,
    SSLv3/TLSv1/TLSv1.1/TLSv1.2) SSLContext provider services: [SunJSSE:
    KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory   aliases:
    [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator<br>
    aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA<br>
    aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2] , SunJSSE:
    Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA<br>
    aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4] , SunJSSE:
    Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA<br>
    aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5,
    1.3.14.3.2.29, OID.1.3.14.3.2.29] , SunJSSE: Signature.MD5andSHA1withRSA -> sun.security.ssl.RSASignature ,
    SunJSSE: KeyManagerFactory.SunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$SunX509 , SunJSSE:
    KeyManagerFactory.NewSunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$X509   aliases: [PKIX] ,
    SunJSSE: TrustManagerFactory.SunX509 ->
    sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory , SunJSSE:
    TrustManagerFactory.PKIX ->
    sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory   aliases:
    [SunPKIX, X509, X.509] , SunJSSE: SSLContext.TLSv1 ->
    sun.security.ssl.SSLContextImpl$TLS10Context   aliases: [SSLv3] ,
    SunJSSE: SSLContext.TLSv1.1 ->
    sun.security.ssl.SSLContextImpl$TLS11Context , SunJSSE:
    SSLContext.TLSv1.2 -> sun.security.ssl.SSLContextImpl$TLS12Context ,
    SunJSSE: SSLContext.TLS -> sun.security.ssl.SSLContextImpl$TLSContext 
    aliases: [SSL] , SunJSSE: SSLContext.Default ->
    sun.security.ssl.SSLContextImpl$DefaultSSLContext , SunJSSE:
    KeyStore.PKCS12 -> sun.security.pkcs12.PKCS12KeyStore ] java.ext.dirs:
    C:\Java\jre8\lib\ext;C:\Windows\Sun\Java\lib\ext 27-Jan-2016
    11:50:57.371 INFO [pool-3-thread-1]
    com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL java.security path:
    C:\Java\jre8\lib\security Security providers: [SUN version 1.8,
    SunRsaSign version 1.8, SunEC version 1.8, SunJSSE version 1.8, SunJCE
    version 1.8, SunJGSS version 1.8, SunSASL version 1.8, XMLDSig version
    1.8, SunPCSC version 1.8, SunMSCAPI version 1.8] SSLContext provider info: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories,
    SSLv3/TLSv1/TLSv1.1/TLSv1.2) SSLContext provider services: [SunJSSE:
    KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory   aliases:
    [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator<br>
    aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1] , SunJSSE:
    Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA<br>
    aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2] , SunJSSE:
    Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA<br>
    aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4] , SunJSSE:
    Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA<br>
    aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5,
    1.3.14.3.2.29, OID.1.3.14.3.2.29] , SunJSSE: Signature.MD5andSHA1withRSA -> sun.security.ssl.RSASignature ,
    SunJSSE: KeyManagerFactory.SunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$SunX509 , SunJSSE:
    KeyManagerFactory.NewSunX509 ->
    sun.security.ssl.KeyManagerFactoryImpl$X509   aliases: [PKIX] ,
    SunJSSE: TrustManagerFactory.SunX509 ->
    sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory , SunJSSE:
    TrustManagerFactory.PKIX ->
    sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory   aliases:
    [SunPKIX, X509, X.509] , SunJSSE: SSLContext.TLSv1 ->
    sun.security.ssl.SSLContextImpl$TLS10Context   aliases: [SSLv3] ,
    SunJSSE: SSLContext.TLSv1.1 ->
    sun.security.ssl.SSLContextImpl$TLS11Context , SunJSSE:
    SSLContext.TLSv1.2 -> sun.security.ssl.SSLContextImpl$TLS12Context ,
    SunJSSE: SSLContext.TLS -> sun.security.ssl.SSLContextImpl$TLSContext 
    aliases: [SSL] , SunJSSE: SSLContext.Default ->
    sun.security.ssl.SSLContextImpl$DefaultSSLContext , SunJSSE:
    KeyStore.PKCS12 -> sun.security.pkcs12.PKCS12KeyStore ] java.ext.dirs:
    C:\Java\jre8\lib\ext;C:\Windows\Sun\Java\lib\ext</p>
  </blockquote>