B4J Question [JServer SSL] no valid keystore problem

Waldemar Lima

Well-Known Member
Licensed User
hello everyone !!

I already created a keystore using keytool and openssl ,but no matter what I make the error persists [ java.lang.IllegalStateException: no valid keystore ]

Log :
B4X:
Waiting for debugger to connect...
Program started.
2019-08-14 10:44:05.735:INFO::main: Logging initialized @6429ms to org.eclipse.jetty.util.log.StdErrLog
ago 14, 2019 10:44:09 AM com.mchange.v2.log.MLog
INFORMAテ・髭S: MLog clients using java 1.4+ standard logging.
ago 14, 2019 10:44:13 AM com.mchange.v2.c3p0.C3P0Registry
INFORMAテ・髭S: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
ago 14, 2019 10:44:14 AM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
INFORMAテ・髭S: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 5, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge137a414236tr8ctiea|1b0375b3, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge137a414236tr8ctiea|1b0375b3, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://letspartygo.com:3306/letspa08_db?characterEncoding=utf8&autoReconnect=true&useSSL=false, maxAdministrativeTaskTime -> 0,...
Database Sync
2019-08-14 10:44:21.182:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_201-b09
2019-08-14 10:44:22.016:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2019-08-14 10:44:22.016:INFO:oejs.session:main: No SessionScavenger set, using defaults
2019-08-14 10:44:22.059:INFO:oejs.session:main: node0 Scavenging every 600000ms
2019-08-14 10:44:22.326:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@255b53dc{/,file:///C:/Users/Waldemar%20Lima/Documents/b4j/Projects/PartyGO%20-%20Server/Objects/www/,AVAILABLE}
2019-08-14 10:44:22.557:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Users\Waldemar Lima\Documents\b4j\Projects\PartyGO - Server\Objects\logs\b4j-2019_08_14.request.log
2019-08-14 10:44:23.112:INFO:oejs.AbstractConnector:main: Started ServerConnector@7316411{HTTP/1.1,[http/1.1]}{0.0.0.0:80}
Error occurred on line: 40
java.lang.IllegalStateException: no valid keystore
    at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(CertificateUtils.java:50)
    at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(SslContextFactory.java:1071)
    at org.eclipse.jetty.util.ssl.SslContextFactory.load(SslContextFactory.java:262)
    at org.eclipse.jetty.util.ssl.SslContextFactory.doStart(SslContextFactory.java:229)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
    at org.eclipse.jetty.server.SslConnectionFactory.doStart(SslConnectionFactory.java:72)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:279)
    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.server.Server.doStart(Server.java:398)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:220)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:676)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:29)

someone know how can i fix it ?
 
Last edited:

Waldemar Lima

Well-Known Member
Licensed User
thanks @OliverA , i fix it ... but when i load page from android webview i get this error : " SSL_UNTRUSTED "

In new versions of android, they accept https urls that return the error: SslError1.SSL_UNTRUSTED?
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
In new versions of android, they accept https urls that return the error: SslError1.SSL_UNTRUSTED?
But then why have an SSL certificate if all you do is trust just any SSL certificate? The issue is that you created a self-signed certificate. Letsencrypt certificates are free, then why not just create one of those and then you don't have to muck with your Android app to accept all certificates and therefore bypassing the security that SSL is supposed to provide.
 
Upvote 0
Top