-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Unable to connect to Parse API' since enabling HTTPS #411
Comments
Need a bit more context. Where is the code running / what type of client is making the request and gets this error? |
Sure. I'm using a chrome plugin called Postman to make the requests. Our ParseServer was created using this AWS-ParseServer guide. Here's the main part of our
The error occurs when I make a |
Any progress? same issue |
We ended up setting |
@omairvaiyani I wonder if it's because of MongoLab |
I looked into the code at the time and am pretty sure it didn't have anything to do with MongoLab. From what I remember, the REST request made by the server never reached back to the server - the HTTP response code was I think the more long-term fix would be to question why a REST call is being made by the server to itself? Should the code not be triggered locally? |
@omairvaiyani we are still discussing the best model for how to handle this issue in the long term. In the meantime, you should be able to use |
I moved everything over to be running off of https://localhost, install a self singed cert, but my dashboard is not loading the server. I can use the same usrl to interact with my cloud code, and can see the "unauthorized" message at the url on the browser, so i know thats the correct url for the server. the dashboard still errors with, My dashboard loads the server if i change it back to the external url, however the cloud code fails to interact with the database. |
+1 |
@Spacelapp We've set our serverUrl to 'localhost:port' to counter-act this. |
I already tried this...but when I use a cloud function in my iOS app I get this error: |
Could you show us your config parameters in node for ParseServer? |
Sure: |
Where is your server deployed? AWS often defaults to port 8081 and perhaps the url needs to be |
selfhosted (express) |
this should be reopened again...It's a bug, and it's not fixed with the newest version of parse-server |
Well it only works, if I setup http & https server at the same time...not really a good solution |
If you refer to my comments earlier, you need to have your server setup This way, any direct communication to your server from the app is done over On Sun, Apr 17, 2016, 3:43 PM Lukas Kovar notifications@github.com wrote:
|
FWIW I also had issues without the |
I am using self hosted parse-server and not able to use cloud functions since I have enabled HTTPS, if I revert it back to HTTP it works as expected. Also he problem is only with those cloud function which have Parse.Query, if i create a function simply return "Hello" as response it works on both HTTP and HTTPS. I am getting following error message when run a cloud function which have Parse.Query code. { "code": 141, "error": "XMLHttpRequest failed: "Unable to connect to the Parse API"--100"} can anyone tell me how can I fix this? |
Have you tried the answers above you? Set |
yes I have tried that, but it doesn't work for me. |
I have fixed this issue. Reason behind this is that node rejects unauthorized TLS. in my parse server instance file. |
Here is what worked for me: Environment: app deployed on AWS, with the load balancer configured for HTTPS On the server side, where you configure parse-server, use HTTP in the serverURL configuration parameter. On the client side, use HTTPS when you initialize the Parse app/library. My theory is that the load balancer is terminating HTTPS traffic, so from the load balancer to the instance, it might be HTTP traffic. In this case, if the parse-server is configured for a HTTPS URL, then it might be trying to listen on a different port or something screwy like that? I'm not an expert on how the AWS architecture works under the hood, so my rationale might be way off or downright incorrect. If anyone can explain why this would work, please chime in. |
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; I am using Elastic Beanstalk as server and can I use this? May I put this in index.js? |
In case anyone is still having this issue, I had the same and managed to fix by changing my Server URL from |
Thanks @natanrolnik! I resolved the same behavior (in development) changing form There is something wrong with the serverURL. The issue only occurred in beforeSave trigger for me. @gfosco please reopen the issue. |
The serverURL is used in cloud code, it should 99% of the time be http://localhost:[port]/[mountPath]. If you're using https in node, i recommend you start a http sever as well listening on any different port from the https server and pass the host parameter to 127.0.0.1. This will allow communications only from the server itself. |
I just encountered this issue. @flovilmart's response is correct for development (ie running the server locally), but the way I was able to fix it for running on Heroku was by using http instead of https in the serverUrl parameter. @w3care25's fix likely addresses the same issue, tho this is probably a bug. |
Just had this issue. For me the problem was solved by replacing |
We also had this problem for migrating existing Mobile App from parse.com to self Hosted Parse server on AWS but as mentioned by someone in this thread we simply changed the URL from HTTPs to HTTP on load balancer and used HTTPs only on client side this seems working. |
I am still having this problem. I had the parse server set up and both the iOS app and the parse dashboard were able to connect over http. I then changed the AWS load balancer to accept client side traffic on port 443 and set a valid SSL certificate. I changed the uri in the parse dashboard and the parse dashboard can connect fine still. I changed the uri in the iOS app and the iOS app cannot connect. If I enable port 80 on the AWS load balancer, the iOS app can connect fine regardless of what the uri is set to in the iOS app. The parse URL is currently defined as https://parse-server.com:443/parse in the iOS app. The parse iOS library seems to be ignoring both the "https" and the "443". Inside the parse-server I have serverURL: process.env.SERVER_URL || 'https://parse-server.com/parse' |
Was there ever a solution for this? I tried https, http, parse app URL, and localhost in serverURL – none worked. Thoughts anyone? |
The way I got it to work was by adding
to settings.py |
My Application is using the perfect storm, SSL, File Storage, Cloud code. This meant that I couldn't set the server url env variable to localhost as this broke the file urls that were output. After investigating the function code, I saw the the credentials are set before ever function execution, so This "solved" the issue for me, I added this as an additional env var as above PARSE_API_URL var ParseApi = process.env.PARSE_API_URL
Parse.Cloud.define("name", function(request, response)
{
Parse.serverURL = ParseApi; |
We've added SSL to our AWS-hosted ParseServer, but are receiving this error when running any CloudFunction:
We've updated our
serverUrl
to havehttps
. After a bit of digging around, I ran intoParseServer/middlewares.js#handleParseHeaders
, where I logged thereq.protocol
. It says the protocol ishttp
, even though the requests are sent withhttps
.Just for more info - we have not yet enabled SSL on the mongolabs database.
GET
requests work fine.The text was updated successfully, but these errors were encountered: