Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
¿Cómo acceder a la API protegida https desde ESP8266?

Volveré a publicar todas mis preguntas porque descubrí que el problema es el acceso SSL como lo señaló un usuario aquí. Así que ya no recibí más mensajes 308, pero mi ESP8266 falla cuando intento acceder a cualquier sitio web "https".

Estoy usando este código para intentar acceder a:

 const char* endpoint = "https://hvilela.com:443/api/data/all"; void onClientStateChange(void* arguments, asyncHTTPrequest* aReq, int readyState) { Serial.println(readyState); switch (readyState) { case 0: // readyStateUnsent // Client created, open not yet called break; case 1: // readyStateOpened // open() has been called, connected break; case 2: // readyStateHdrsRecvd // send() called, response headers available break; case 3: // readyStateLoading // receiving, partial data available break; case 4: // readyStateDone // Request complete, all data available. #ifdef SERIAL_DEBUG Serial.println(aReq->responseHTTPcode()); #endif if (aReq->responseHTTPcode() != 200) { #ifdef SERIAL_DEBUG Serial.println("return"); #endif return; } String response = aReq->responseText(); #ifdef SERIAL_DEBUG Serial.println(response.c_str()); #endif break; } } void setupClient() { String URL2 = endpoint; client2.setTimeout(5); client2.setDebug(true); client2.onReadyStateChange(onClientStateChange); client2.open("GET", URL2.c_str()); client2.send(); delay(1000); Serial.println("[Client setup end]"); }

al acceder a este punto final, necesito recibir un mensaje 410 no autorizado. Funciona perfectamente en navegadores web, pero no en ESP8266.

Además, estoy usando el complemento PlatformIO VSCode para programar.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La respuesta de @gre_gor fue la clave para descubrir el verdadero problema.

Obtuve el ejemplo de BasicHttps y comencé a trabajar, pero no funcionó por completo.

Pensé en un problema con el servidor Vercel, pero finalmente, lo que explicaba las redirecciones también era un problema relacionado con 'google-domains' que estaba teniendo.

hvilela.com es un nombre en los dominios de Google , pero dentro de Vercel esto va a otra página (aunque no sé por qué esta página no era la Ubicación en el consejo 308), y solo en esta página 'dentro de Vercel' pude acceder a la API correctamente.

Espero que esto pueda ayudar a quienes tengan los mismos problemas en el futuro.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!