title: ESP8266 WiFiClientSecure Exception 9
body: <p>I have a few problems trying to connect my ESP8266 to my WebServer.
  I want to connect to a Webserver and then send Information via the REST-API to the Server.</p>
  <p>Unfortually my Program Crashes when connecting to the Server.</p>
  <p>This is my code:</p>
  <pre><code>#include &lt;ESP8266WiFi.h&gt;
  #include &lt;WiFiClientSecure.h&gt;
  
  #ifndef STASSID
  #define STASSID &quot;SSID&quot; //SSID
  #define STAPSK  NULL //Password
  #endif
  
  const char* ssid = STASSID;
  const char* password = STAPSK;
  
  const char* host = &quot;IP-Adress&quot;; //Load Balancer IP
  const uint16_t httpsPort = 443; //Load Balancer Port
  
  // Use web browser to view and copy SHA1 fingerprint of the certificate
  const char fingerprint[] PROGMEM = &quot;FI NG ER PR IN T0&quot;;
  
  void setup() {
    Serial.begin(115200);
    
    Serial.println(&quot;[INFO]\t\tStarting GPS Service&quot;);
    Serial.printf(&quot;[INFO] LAN:\tConnecting to WiFi '%s'&quot;, ssid);
    
    WiFi.mode(WIFI_STA); //Setting WiFi Client Mode
    WiFi.begin(ssid, password); //Connecting to WiFi
    
    while (WiFi.status() != WL_CONNECTED) {
      delay(250);  Serial.print(&quot;.&quot;); //Waiting for WiFi Connection
    }
    Serial.print(&quot;\n&quot;);
    
    Serial.printf(&quot;[INFO] LAN:\tSuccessfully Connected to WiFi '%s'\n&quot;, ssid);
    Serial.print(&quot;[INFO] LAN:\tLocal IP-Address '&quot;);
    Serial.print(WiFi.localIP());
    Serial.print(&quot;'\n&quot;);
    
    Serial.printf(&quot;[INFO] WAN:\tConnecting to %s:%d\n&quot; ,host, httpsPort);
    
    WiFiClientSecure client; // Use WiFiClientSecure class to create TLS connection
  
    Serial.printf(&quot;[INFO] WAN:\tUsing fingerprint '%s'\n&quot;, fingerprint);
    
    client.setFingerprint(fingerprint); //Set Fingerprint for WiFiClientSecure
  
    if (client.connect(host, httpsPort)) { //Here my Programm is Crashing
      Serial.printf(&quot;[INFO] WAN:\tSuccessfully Connected to WAN-IP '%s'\n&quot;, host);  
    } else {
      Serial.println(&quot;[ERROR] WAN:\tConnection failed!&quot;);
      return;
    }
    Serial.println(&quot;[INFO] WAN:\tClosing connection&quot;);
  }
  
  void loop() {
  }
  </code></pre>
  <p>The Programm Crashes at this Point <code>if (client.connect(host, httpsPort)) {</code></p>
  <p>This is the Output:</p>
  <pre><code>[INFO] Starting GPS Service
  [INFO] LAN: Connecting to WiFi 'SSID'.
  [INFO] LAN: Successfully Connected to WiFi 'SSID'
  [INFO] LAN: Local IP address '192.168.178.*'
  [INFO] WAN: Connecting to Server-Adress
  [INFO] WAN: Using fingerprint 'FI NG ER PR IN T0'
  
  --------------- CUT HERE FOR EXCEPTION DECODER ---------------
  
  Exception (9):
  epc1=0x40207874 epc2=0x00000000 epc3=0x00000000 excvaddr=0xfeefeffe depc=0x00000000
  
  &gt;&gt;&gt;stack&gt;&gt;&gt;
  ...
  &lt;&lt;&lt;stack&lt;&lt;&lt;
  
  --------------- CUT HERE FOR EXCEPTION DECODER ---------------
  </code></pre>
  <p>When I decode the Stack i get the Following:</p>
  <pre><code>Decoding 12 results
  0x40203aab: BearSSL::WiFiClientSecure::_connectSSL(char const*) at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.cpp line 1093
  0x40205878: esp_yield at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\cores\esp8266/core_esp8266_main.cpp line 119
  0x40205e72: __delay at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\cores\esp8266/core_esp8266_wiring.cpp line 54
  0x402026c0: WiFiClient::connect(IPAddress, unsigned short) at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\libraries\ESP8266WiFi\src/include/ClientContext.h line 144
  : (inlined by) WiFiClient::connect(IPAddress, unsigned short) at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\libraries\ESP8266WiFi\src/WiFiClient.cpp line 170
  0x40203c81: BearSSL::WiFiClientSecure::connect(char const*, unsigned short) at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.cpp line 229
  0x40207e20: precache at ?? line ?
  0x40207e20: precache at ?? line ?
  0x40250e56: sleep_reset_analog_rtcreg_8266 at ?? line ?
  0x40201138: setup at C:\Users\Username\Desktop\Beispiele\WiFi/WiFi.ino line 58
  0x40207cc0: precache at ?? line ?
  0x40205988: loop_wrapper() at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\cores\esp8266/core_esp8266_main.cpp line 194
  0x40100bd5: cont_wrapper at C:\Users\Username\Desktop\ArduinoPortable\App\arduino\portable\packages\esp8266\hardware\esp8266\2.7.3\cores\esp8266/cont.S line 81 
  </code></pre>
  <p>Anyone got an Idea how to fix this?
  Thanks in advance,
  Patrick</p>