TIMX Member Licensed User Nov 17, 2017 #1 Dim j As HttpJob j.Initialize("j", Me) j.PostString("http://www.example.com","token="&token) Is it work with server that have SSL certificate with https connection?
Dim j As HttpJob j.Initialize("j", Me) j.PostString("http://www.example.com","token="&token) Is it work with server that have SSL certificate with https connection?
KMatle Expert Licensed User Longtime User Nov 18, 2017 #2 Just try Of course, but only if you call it with https instead of http. The rest is handled automatically. The certificate must (of course) be valid. Upvote 0
Just try Of course, but only if you call it with https instead of http. The rest is handled automatically. The certificate must (of course) be valid.
TIMX Member Licensed User Nov 18, 2017 #3 I test the next situations: reqManager.Initialize(Me,"https://www.example.com") and it work fine, I can make a success get Request when I Post the next request j.PostString("https://www.example.com","token="&token) I get the next Message :ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to www.example.com (port 51044) after 30000ms, Response: I'm no sure how HttpJob manage the request. Possible it sends http://www.example.com or https://www.example.com, because if it's the first the server never will be respond Both are in the same server but different service. Upvote 0
I test the next situations: reqManager.Initialize(Me,"https://www.example.com") and it work fine, I can make a success get Request when I Post the next request j.PostString("https://www.example.com","token="&token) I get the next Message :ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to www.example.com (port 51044) after 30000ms, Response: I'm no sure how HttpJob manage the request. Possible it sends http://www.example.com or https://www.example.com, because if it's the first the server never will be respond Both are in the same server but different service.
nwhitfield Active Member Licensed User Longtime User Nov 18, 2017 #4 If you pass an https URL, then PostString will just handle it all by magic. If you're getting a timeout, then you most likely have a network problem. Do you have any other tools you can use on the same network to check the connection to the URL you're trying to reach. For example, if you have OpenSSL installed (on Linux, Mac for instance). you could use the command Code: openssl s_client -connect example.com:443 to check that you can make a connection from your network to that address, on the default port used for SSL. Then entering Code: GET / HTTP/1.0 will retrieve the server's home page. Can you browse to the SSL port on that server? (Not much good if it only accepts POST, but there should at least be some sort of page). Upvote 0
If you pass an https URL, then PostString will just handle it all by magic. If you're getting a timeout, then you most likely have a network problem. Do you have any other tools you can use on the same network to check the connection to the URL you're trying to reach. For example, if you have OpenSSL installed (on Linux, Mac for instance). you could use the command Code: openssl s_client -connect example.com:443 to check that you can make a connection from your network to that address, on the default port used for SSL. Then entering Code: GET / HTTP/1.0 will retrieve the server's home page. Can you browse to the SSL port on that server? (Not much good if it only accepts POST, but there should at least be some sort of page).
Erel B4X founder Staff member Licensed User Longtime User Nov 19, 2017 #5 Why are you using DBRequestManager to test http requests? DBRequestManager can only be used to connect to jRDC2 servers. Upvote 0
Why are you using DBRequestManager to test http requests? DBRequestManager can only be used to connect to jRDC2 servers.
TIMX Member Licensed User Nov 28, 2017 #6 Erel said: Why are you using DBRequestManager to test http requests? DBRequestManager can only be used to connect to jRDC2 servers. Click to expand... I'm integrating in a server two services "jRDC2 and PushServer", both are running on differents ports, the last service listen devices request for authorization token for Push communication and the other manage the database conecctions. This server work fine over basic server, but over secure server (with SSL proxy) the Push service don't work from internet or intranet, attach my network diagram Attachments Diagrama1.jpeg 45.3 KB · Views: 484 Upvote 0
Erel said: Why are you using DBRequestManager to test http requests? DBRequestManager can only be used to connect to jRDC2 servers. Click to expand... I'm integrating in a server two services "jRDC2 and PushServer", both are running on differents ports, the last service listen devices request for authorization token for Push communication and the other manage the database conecctions. This server work fine over basic server, but over secure server (with SSL proxy) the Push service don't work from internet or intranet, attach my network diagram
Erel B4X founder Staff member Licensed User Longtime User Nov 29, 2017 #7 To answer the original question (from the title): Yes. HttpJob.Post works with https urls. No need to do anything special if the certificate is valid. If not then you can initialize OkHttpClient with InitializeAcceptAll. For further discussion about how to configure your B4J servers to run over SSL, please start a new thread in B4J forum. Upvote 0
To answer the original question (from the title): Yes. HttpJob.Post works with https urls. No need to do anything special if the certificate is valid. If not then you can initialize OkHttpClient with InitializeAcceptAll. For further discussion about how to configure your B4J servers to run over SSL, please start a new thread in B4J forum.