title: SMTP config and java error in ReportServer. No password supplied for PKCS#12 KeyStore
body: <p>I am trying to config smtp for scheduled reports in ReportServer.
  So my smtp congif:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
     &lt;smtp&gt;
        &lt;host&gt;smtp.gmail.com&lt;/host&gt;
        &lt;port&gt;587&lt;/port&gt;
        &lt;username&gt;xxx@gmail.com&lt;/username&gt;
        &lt;password&gt;xxx&lt;/password&gt;
  
        &lt;ssl&gt;false&lt;/ssl&gt;
        &lt;tls&gt;
           &lt;enable&gt;true&lt;/enable&gt;
           &lt;require&gt;false&lt;/require&gt;
        &lt;/tls&gt;
     &lt;/smtp&gt;
     &lt;mail&gt;
        &lt;sender&gt;xxx@gmail.com&lt;/sender&gt;
        &lt;forceSender&gt;false&lt;/forceSender&gt;
        &lt;encryptionPolicy&gt;allow_mixed&lt;/encryptionPolicy&gt;
     &lt;/mail&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I tried different configurations using ssl true, port 465. </p>
  
  <p><a href="https://forum.reportserver.net/viewtopic.php?pid=2291#p2291" rel="nofollow noreferrer">https://forum.reportserver.net/viewtopic.php?pid=2291#p2291</a></p>
  
  <p>I also used this configuration on Knowage BI and it worked but it did not have scheduler on free version so I tried ReportServer.</p>
  
  <p>Now I can't figure this error out:</p>
  
  <pre><code>java.lang.RuntimeException: javax.mail.MessagingException: Could not convert socket to TLS;
    nested exception is:
      java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
      at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction$1.handleException(MailReportAction.java:149)
      at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:243)
      at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction.doExecute(MailReportAction.java:140)
      at net.datenwerke.scheduler.service.scheduler.entities.AbstractAction.execute(AbstractAction.java:59)
      at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeAction(SchedulerTask.java:495)
      at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeActions(SchedulerTask.java:385)
      at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.safeCall(SchedulerTask.java:209)
      at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:101)
      at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:1)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: javax.mail.MessagingException: Could not convert socket to TLS;
    nested exception is:
      java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
      at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1918)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:652)
      at javax.mail.Service.connect(Service.java:317)
      at javax.mail.Service.connect(Service.java:176)
      at javax.mail.Service.connect(Service.java:125)
      at javax.mail.Transport.send0(Transport.java:194)
      at javax.mail.Transport.send(Transport.java:124)
      at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:233)
      ... 11 more
  Caused by: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
      at java.base/javax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:263)
      at java.base/javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:285)
      at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:484)
      at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1913)
      ... 18 more
  Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
      at java.base/java.security.Provider$Service.newInstance(Provider.java:1831)
      at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
      at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
      at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:168)
      at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:99)
      at java.base/javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:123)
      at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:479)
      ... 19 more
  Caused by: java.lang.NullPointerException: No password supplied for PKCS#12 KeyStore.
      at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(Unknown Source)
      at java.base/java.security.KeyStore.load(KeyStore.java:1479)
      at java.base/sun.security.ssl.TrustStoreManager$TrustAnchorManager.loadKeyStore(TrustStoreManager.java:365)
      at java.base/sun.security.ssl.TrustStoreManager$TrustAnchorManager.getTrustedCerts(TrustStoreManager.java:313)
      at java.base/sun.security.ssl.TrustStoreManager.getTrustedCerts(TrustStoreManager.java:55)
      at java.base/sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:49)
      at java.base/javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:278)
      at java.base/sun.security.ssl.SSLContextImpl$DefaultManagersHolder.getTrustManagers(SSLContextImpl.java:1052)
      at java.base/sun.security.ssl.SSLContextImpl$DefaultManagersHolder.&amp;lt;clinit&amp;gt;(SSLContextImpl.java:1022)
      at java.base/sun.security.ssl.SSLContextImpl$DefaultSSLContext.&amp;lt;init&amp;gt;(SSLContextImpl.java:1197)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      at java.base/java.security.Provider.newInstanceUtil(Provider.java:153)
      at java.base/java.security.Provider$Service.newInstance(Provider.java:1824)
      at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
      at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
      at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:168)
      at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:99)
      at java.base/javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:123)
      at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:479)
      at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1913)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:652)
      at javax.mail.Service.connect(Service.java:317)
      at javax.mail.Service.connect(Service.java:176)
      at javax.mail.Service.connect(Service.java:125)
      at javax.mail.Transport.send0(Transport.java:194)
      at javax.mail.Transport.send(Transport.java:124)
      at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:233)
      at net.datenwerke.rs.core.service.mail.MailServiceImpl$1.run(MailServiceImpl.java:266)
      ... 3 more
  </code></pre>
  
  <p>So I read a few topics, maybe I am missing certificate, I am not sure. Kind of fresh here. </p>
  
  <p>Additional information:
  Java jdk_1.8.0_202
  Windows 7</p>
  
  <p>Thanks for the help.</p>