HTTPS Connection - java-me

I am making an application which has j2me in client side and dotnet on server side.
I need to make an https connection to post to and fetch data from the server.
Can anyone help?
I tried searching on the net but i cannot find much on internet about establishing https connection.
Can anyone explain or reccommend a website??

If you had problems finding J2ME HTTPS examples, this is a nice article.
The above link doesn't work any more. Alternative articles:
IBM Developerworks

Possible causes of https not working is because the server does not have a valid certificate. Try catching exceptions in the part where you make the connection.

Related

Is socket.io or websocket safe to use with an express server?

I was wondering to have a realtime system made with express and i came to know about socket.io and websockets. But the way they are used i.e.
const io = socket.io("https://example.com") ;
Is it safe to use. Since the url for socket connection is available at client side any third party service can enjoy and exploit the services by connecting from their service. I don't have much idea about socket.io so correct me if I am wrong.
Kindly don't mark this question as duplicate since I found a similar question but the answer to it was related to game development, here I am specific about updating clients whenever any updates are there on the server side. Clients may be website made with angular or apps made with Android studio.
Any help is highly appreciable.
socket.io is widely used. It is perfectly fine for use in production.
Regarding the authentication part, A websocket connection b/w client and browser is established via http upgrade request(in http/1.1).
If you have an authentication mechanism in place for your application using cookie and session then you should be safe. No one can establish websocket connection directly without first logging in. On top of this you can limit connection per user to ensure that a registered user cant further exploit the connection using the cookie data.

Problem with OpenSSL on Catalina using node.js [duplicate]

I'm using the node-request module, regularly sending GET requests to a set of URLs and, sometimes, getting the error below on some sites.
Error: 29472:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:683
The problem is that I don't get this error always or always on the some URLs, just sometimes. Also, it can't be ignored with "strictSSL: false".
I have read that this can be related to me sending SSL requests with the wrong protocol (SSLv2, SSLv3, TLS..). But this doesn't explain why it happens irregularly.
Btw, I'm running nodejs on a Win 2008 server.
Any help is appreciated.
You will get such error message when you request HTTPS resource via wrong port, such as 80. So please make sure you specified right port, 443, in the Request options.
This was totally my bad.
I was using standard node http.request on a part of the code which should be sending requests to only http adresses. Seems like the db had a single https address which was queried with a random interval.
Simply, I was trying to send a http request to https.
I got this error because I was using require('https') where I should have been using require('http').
Some of the sites are speaking SSLv2, or at least sending an SSLv2 server-hello, and your client doesn't speak, or isn't configured to speak, SSLv2. You need to make a policy decision here. SSLv2 should have vanished from the face of the earth years ago, and sites that still use it are insecure. However, if you gotta talk to them, you just have to enable it at your end, if you can. I would complain to the site owners though if you can.
I had this problem (403 error for each package) and I found nothing great in the internet to solve it.
My .npmrc file inside my user folder was wrong and misunderstood.
I changed this npmrc line from
proxy=http://XX.XX.XXX.XXX:XXX/
to :
proxy = XX.XX.XXX.XXX:XXXX
var https = require('https');
https.globalAgent.options.secureProtocol = 'SSLv3_method';
I got this error while connecting to Amazon RDS. I checked the server status 50% of CPU usage while it was a development server and no one is using it.
It was working before, and nothing in the connection configuration has changed.
Rebooting the server fixed the issue for me.
So in Short,
vi ~/.proxy_info
export http_proxy=<username>:<password>#<proxy>:8080
export https_proxy=<username>:<password>#<proxy>:8080
source ~/.proxy_info
Hope this helps someone in hurry :)
in my case (the website SSL uses ev curves) the issue with the SSL was solved by adding this option ecdhCurve: 'P-521:P-384:P-256'
request({ url,
agentOptions: { ecdhCurve: 'P-521:P-384:P-256', }
}, (err,res,body) => {
...
JFYI, maybe this will help someone
I got this error, while using it on my rocketchat to communicate with my gitlab via enterprise proxy,
Because, was using the https://:8080 but actually, it worked for http://:8080

Socket.IO Connection Not working on University Wifi

I have created an chat app using Socket.IO . It works fine on my home internet. But whenever I am at my university and connected to versity wifi internet, I can't get connected at all. Its facing 'net::ERR_CONNECTION_TIMED_OUT' error.
Here is the url: demo.codesamplez.com/ultrachat/demo.html (You will may get it OK, as I do on home)
I guess, this might be some kind of firewall issue or something?
Does anybody has any clue how to go forward for solving this? Thanks in advance.
Switching from HTTP to HTTPS should get around the problem with incompatible proxy server. That forces the proxy to use HTTP tunneling to maintain the connection instead performing whatever magic it does.

Browser, behind Squid, can't establish connection to socket.io websockets transport

My problem is simple to explain but not so simple to fix I think since I haven't found a solution yet.
I'm developing an API. The backend is developed using NodeJs and Socket.Io. Everything works perfect but the issue arises when I'm on a net that's behind a firewall, Squid in this case. It is the browser who is behind the firewall not the server (NodeJs).
The thing is that I get this error:
WebSocket connection to 'ws://mydomain.com/socket.io/1/websocket/vN8hWt_EjV0Z5P5-GwrW' failed: Unexpected response code: 502 (socket.io.js:2)
and I don't know how to the browser can skip Squid.

XMPPHP Could not connect after timeout

I am trying to create a web based PHP application which can allow chat to my Gmail friends. Something like meebo.com. I downloaded XMPPHP, and executed on localhost, and it is working fine, but when I uploaded everything to Yahoo Small business web hosting, it is throwing connection timeout error.
Do anyone else faced such problem. I heard many of them did, but no one have any solution yet.
Any suggestion will be very helpful. I am new to XMPP clients.
Just some ideas...
How are you trying to connect to the XMPP server? With XMPPHP you may use two classes which are
XMPPHP
XMPPHP_BOSH
You might try both, since they work on different ports (XMPPHP for example on 5222 and XMPPHP_BOSH on 80). So if this is a port issue, trying XMPPHP_BOSH would be an idea. You will need to find out though if this is supported by the XMPP server you are trying to connect to. And if so, you need to know the url the server exposes the BOSH service on.
Anyways, I would recommend to check out what kind of 'restrictions' there are in Yahoo Small business web hosting and on the side of the XMPP server.
If you intend to check XMPPHP_BOSH out, consider this issue to make it work: Issue 47: Http-bind error. All in all XMPPHP seems very buggy and incomplete...

Resources