9

I created API with PHP and am testing it now.

It goes success with chrome and firefox, but safari gets error, "NSPOSIXErrorDomain:100."

This error sometime happens and sometime I can get a correct response from API.

Does anyone know anything about this kind of error? I still don't understand even which part is causing this error...Is this because of server, AWS, SSL, PHP, or client browser?

Here is some info of my API.

datenshidon
  • 121
  • 2
  • 7
  • okay, I found the following thread and seems my case might result from load balancers on AWS. https://stackoverflow.com/questions/41461481/error-domain-nsposixerrordomain-code-100-protocol-error – datenshidon Jun 19 '18 at 03:49

2 Answers2

20

I had the same problem calling PHP APIs deployed behind an AWS Load Balancer (I don't know if Load Balancer is present in your settings). I have solved the issue by disabling the use of HTTP 2.0 in the load balancer. In order to disable HTTP 2.0, select your Load Balancer in the AWS console then select Action -> Edit Attributes and disable HTTP/2

enter image description here

If you're not using a Load Balancer you have to check your webserver settings in order to figure out which HTTP version is enabled.

Andrea Gorrieri
  • 1,704
  • 2
  • 22
  • 36
  • 1
    In my opinion, there is no sense in disabling HTTP/2 just because one browser doesn't support it well. This issue may be caused by the `Upgrade` header. – Vokiel Feb 14 '19 at 18:41
  • 2
    Vokiel in my case the problem was related to a mobile iOS application so I solved in this way, actually ragarding browsers you may be right but unfortunately I don't know how the problem can be solved in other ways – Andrea Gorrieri Feb 14 '19 at 18:45
  • I had a similar issue as Andrea. Our iOS application could not load any video due to this setting. Disabling HTTP/2 immediately solved the issue. – Baron Ch'ng Aug 19 '20 at 11:41
6

I fixed this problem by inserting the following as the very first line of the .htaccess file:

Header unset Upgrade
Das_Geek
  • 2,775
  • 7
  • 20
  • 26
Scott Regan
  • 61
  • 1
  • 1