title: iOS - Alamofire - cannot reach server on WiFi
body: <p>I am slowly distributing my app to Beta testers via TestFlight.</p>
  <p>A few of them have already reported that the app showed “No Internet connection” while on WiFi. As soon as they switched to cellular everything started to work. The WiFi works for everything else.</p>
  <p>I use Alamofire as a framework to make HTTPRequests and when these requests fail, “No Internet connection” error is displayed.</p>
  <ul>
  <li>My backend service is hosted on Google Cloud</li>
  <li>My domain is registered using AWS Route 53</li>
  <li>I use SSL certificates managed by Google</li>
  </ul>
  <p>All HTTPRequests are sent to <a href="https://api.myapp.com" rel="nofollow noreferrer">https://api.myapp.com</a> (where myapp.com is hosted on AWS).</p>
  <p>All of the testers have Automatic DNS resolution set in Settings -&gt; WiFi -&gt; (i) -&gt; DNS</p>
  <p>Any ideas what the cause can be or how I can further investigate this issue?</p>
  <p>This is the piece of code used to make GET requests:</p>
  <pre class="lang-swift prettyprint-override"><code>    func getJSON(_ url: String,
                   parameters: [String: String] = [:],
                   headers: [String: String] = [:],
                   completionHandler: @escaping (_ result: JSON?,
                                                 _ headers: [String: String]?,
                                                 _ statusCode: Int?,
                                                 _ error: Error?) -&gt; Void) {
          
          Self.sessionManager.request(
              url,
              method: .get,
              parameters: parameters,
              headers: self.createHeaders(headers: headers),
              interceptor: self,
              requestModifier: { $0.timeoutInterval = HttpClient.defaultTimeoutInterval }
          ).validate().responseJSON { response in
              
              switch response.result {
              case .success(let data):
                  let json = JSON(data)
                  completionHandler(json, self.getResponseHeaders(httpUrlResponse: response.response), response.response?.statusCode, nil)
                  
              case .failure(let error):
                  completionHandler(nil, self.getResponseHeaders(httpUrlResponse: response.response), response.response?.statusCode, error)
              }
          }
      }
  </code></pre>
  <p>The connection error is displayed when <code>error != nil</code>. When it happens, it happens for all HTTP endpoints (does not matter if an endpoint requires authentication or authorization, all HTTP requests fail).</p>