iOS Question Cannot connect to build server

nobbi59

Active Member
Licensed User
Longtime User
Hey there,

Im using a local mac builder (v. 5.5) but I cant download Apps from the server using my phone, neither the Bridge Application or a compiled App.

When I try to do so, I get a message saying "Cannot connect to [Server IP]".

I know this problem is due to a wrong SSL certificate. The Server IP is right and I can connect to the non-ssl version from my Windows PC. I get this Error message in chrome when I try to connect via the SSL Port: "ERR_CERT_AUTHORITY_INVALID"

Everything is configured as Erel explained in the Installation Tutorial.

I just can't figure out what the problem might be. When I run the command "keytool -list -v -keystore key.jks -storepass 123456" in the Key folder, the end of the output is:

B4X:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore key.jks -destkeystore pkcs12".
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Deleted two posts of "similar problems". Please always start a new thread for your questions.

Ive done everything correctly as stated in the Tutorials.
This can only be said after you get it working ;)

Are you able to compile with the hosted builders? If you don't have an account then contact [email protected] and we will send you a temporary id.

Once it is working with the hosted builders you should stop the local server, delete the keys folder on your Mac and start again. Post the server output.
 
Upvote 0

nobbi59

Active Member
Licensed User
Longtime User
Thats right @Erel Ive sent you an EMail to get a hosted builder account. But I can tell you that its been working using hosted builder ~2 Months ago.

And the fact that I cant reach the HTTPS test site using Google Chrome on my Win PC also tells me that it's not a problem with the phone. Im gonna send the server logs in the next post.
 
Upvote 0

nobbi59

Active Member
Licensed User
Longtime User
Here is the server log: (deleted key folder before start)

mac:BuildServerNEW leonludwig$ java -jar B4iBuildServer.jar

Build server version: 5.5

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2019-01-18 10:24:46.038:INFO::main: Logging initialized @186ms to org.eclipse.jetty.util.log.StdErrLog

Loading default configuration file.

AppPath=/Users/leonludwig/Desktop/BuildServerNEW

Mac version: 10.13.6

Xcode path: /Applications/Xcode.app/Contents/Developer

Xcode version: 10.1

Creating key for: 192.168.2.114

2019-01-18 10:24:48.382:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_201-b09

2019-01-18 10:24:48.448:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0

2019-01-18 10:24:48.448:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults

2019-01-18 10:24:48.450:INFO:eek:ejs.session:main: node0 Scavenging every 600000ms

2019-01-18 10:24:48.470:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1e127982{/,file:///Users/leonludwig/Desktop/BuildServerNEW/www,AVAILABLE}

2019-01-18 10:24:48.479:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened /Users/leonludwig/Desktop/BuildServerNEW/logs/b4j-2019_01_18.request.log

2019-01-18 10:24:48.560:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@33ecb664{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}

2019-01-18 10:24:48.615:INFO:eek:ejus.SslContextFactory:main: x509=X509@67784306(rootca,h=[],w=[]) for SslContextFactory@335eadca[provider=null,keyStore=file:///Users/leonludwig/Desktop/BuildServerNEW/key/key.jks,trustStore=null]

2019-01-18 10:24:48.617:INFO:eek:ejus.SslContextFactory:main: x509=X509@210366b4(jetty,h=[192.168.2.114],w=[]) for SslContextFactory@335eadca[provider=null,keyStore=file:///Users/leonludwig/Desktop/BuildServerNEW/key/key.jks,trustStore=null]

2019-01-18 10:24:49.011:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@67b24172{SSL,[ssl, http/1.1]}{0.0.0.0:51042}

2019-01-18 10:24:49.013:INFO:eek:ejs.Server:main: Started @3165ms

Build server is ready

https://192.168.2.114:51042

http://192.168.2.114:51041

Build server version: 5.50
 
Upvote 0

nobbi59

Active Member
Licensed User
Longtime User
Hi @Alberto Iglesias I didnt find the problem. I think its, as chrome says, a problem with the SSL certificate. I know that iOS is really strict about non-SSL connections but I dont know enough about the Build Server to tell whats exactly the problem.

I think ill have to wait until @Erel comes up with a solution, as Ive seen there are many others facing the same issue. But I will try to find a solution myself until someone has a fix for me, if i find a slution, ill report it here.
 
Upvote 0

Leviathan2040

Member
Licensed User
I believe you are experiencing the same problem I have in my other thread. I believe the problem is that on macOS the SSL key and cert used by the Builder.jar have to be inserted and trusted in Keychain application first. I tried to double click the 05.crt (my understanding is that the name of this changes based on the last octet of your computer IP address) certificate inside the 'key' folder, it installs in the Keychain, I then trust it but this has not solved the problem so far. I keep investigating...
 
Upvote 0

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I found something to @Erel debug:

When after click on INSTALL on iphone safari, nothing happen after that I tried to connect direct with the link provided by builder at port 51042, and then
I got this error on SERVER SIDE

B4X:
Build server version: 5.50
Adding user to keychain: xxxxxxxxxxx
12:53:25| Compilation time: 8844, , queue: 0, success: true
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at anywheresoftware.b4j.object.JServlet$Handle.run(JServlet.java:130)
    at anywheresoftware.b4j.object.JServlet.Handle(JServlet.java:110)
    at anywheresoftware.b4j.object.JServlet.doGet(JServlet.java:84)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:531)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:291)
    at org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:151)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1967)
    at b4j.example.download._handle(download.java:50)
    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)
    ... 37 more

I think is a problem inside builder, can you check @Erel?

Thank you and thanks to @Percy Huijer let me debug

Alberto Iglesias

PS: If I create a simple project from my friend machine I got this error, if I create from my machine it works (BOTH with B4i v5.5.0)

Any ideas?
 
Last edited by a moderator:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Any ideas?
I'm sorry but you should start your own thread. I already asked you once. You are making this thread unreadable. Please don't do it again.

And the fact that I cant reach the HTTPS test site using Google Chrome on my Win PC also tells me that it's not a problem with the phone.
This is expected as you haven't installed the B4I certificate in the browser.

My guess is that you haven't trusted the certificate. It should look like this:

SS-2019-01-20_08.50.15.png
 
Upvote 0
Top