title: Appium issue : java.io.IOException: unexpected end of stream Connection
body: <p>Not able to click elements on the application launched. Mobile Application gets downloaded and opens but no element gets clicked, no error on <code>appium</code> server. </p>
  
  <p>Below are the versions used: </p>
  
  <pre><code>Simulator device - iPhone 8
  
  Simulator Version 11.0 (SimulatorApp-912.1 SimulatorKit-570.3 CoreSimulator-681.5.1)
  
  Java client version java-client-6.0.0-BETA4.jar
  
  Appium Version 1.15.1 (1.15.1.20191013.2)
  
  macOS Mojave version 10.14.5 (18F203)
  
  X code Version 11.0 (11A420a)
  
  java version "1.8.0_191"
  
  selenium-java-3.141.59-sources.jar
  </code></pre>
  
  <p>Logs at the console:</p>
  
  <pre><code>
  Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: unexpected end of stream on Connection{127.0.0.1:4723, proxy=DIRECT hostAddress=/127.0.0.1:4723 cipherSuite=none protocol=http/1.1}
  
  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
  
  System info: host: 'C02Z53KELVCF', ip: 'fe80:0:0:0:4d1:face:6ad2:ee7a%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.5', java.version: '1.8.0_191'
  
  Driver info: driver.version: IOSDriver
  
  Driver info: driver.version: IOSDriver
  
    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
  
    at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
  
    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
  
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
  
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
  
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
  
    at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
  
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
  
    at org.openqa.selenium.remote.RemoteWebDriver.&lt;init&gt;(RemoteWebDriver.java:131)
  
    at io.appium.java_client.DefaultGenericMobileDriver.&lt;init&gt;(DefaultGenericMobileDriver.java:38)
  
    at io.appium.java_client.AppiumDriver.&lt;init&gt;(AppiumDriver.java:84)
  
   at io.appium.java_client.AppiumDriver.&lt;init&gt;(AppiumDriver.java:94)
  
    at io.appium.java_client.ios.IOSDriver.&lt;init&gt;(IOSDriver.java:95)
  
    at com.netspend.ns_tester.Selenium.DriverHandler.getLocalDriver(DriverHandler.groovy:193)
  
    ... 22 more
  
  Caused by: java.lang.reflect.InvocationTargetException
  
    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
  
    ... 35 more
  
  Caused by: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:4723, proxy=DIRECT hostAddress=/127.0.0.1:4723 cipherSuite=none protocol=http/1.1}
  
    at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:208)
  
    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
  
    at org.openqa.selenium.remote.internal.OkHttpClient$Factory$1.lambda$createClient$1(OkHttpClient.java:152)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
  
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
  
   at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
  
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
  
   at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
  
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
  
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
  
    at okhttp3.RealCall.execute(RealCall.java:77)
  
    at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
  
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
  
    ... 36 more
  
  Caused by: java.io.EOFException: \n not found: limit=0 content=…
  
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:237)
  
    at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215)
  
    at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
  
    ... 56 more
  </code></pre>