Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot get SSL connections to work #12

Open
eikaramba opened this issue Apr 21, 2019 · 19 comments
Open

cannot get SSL connections to work #12

eikaramba opened this issue Apr 21, 2019 · 19 comments

Comments

@eikaramba
Copy link

Is there any documentation about connecting to SSL websites?
If i try the example from https://www.arduino.cc/en/Tutorial/MKRNBExamplesNBSSLWebClient it does not send the request. It works with http, but i tried several different ssl requests and ssl never works.

00:40:03.016 -> connecting...
00:40:23.535 -> connected

@sandeepmistry
Copy link
Contributor

Hi @eikaramba,

The example is working for me, what version of the library are you using?

Have you tried any other HTTPS servers? The root certs the library is bundled with can be found here: https://github.com/arduino-libraries/MKRNB/blob/master/src/utility/NBRootCerts.h

@eikaramba
Copy link
Author

eikaramba commented Apr 28, 2019

I tried multiple different ssl domains. currently testing with https://webhook.site (using letsencrypt certificate with DST X3 root certificate https://letsencrypt.org/certificates/), and again it works when i'm using port 80 and NBClient(you can call that site with or without ssl), but not if i'm switching to 443 and NBSSLClient.

The behaviour is always like this:

Serial.println("connected");
    // Make a HTTP request:
    client.print("GET ");
    Serial.println("test");
    client.print(path);
    Serial.println("test2");
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(server);
    Serial.println("test3");
    client.println("Connection: close");
    client.println();
    Serial.println("finally");
13:57:26.656 -> Starting Arduino web client.
13:57:44.083 -> connecting...
13:58:03.798 -> connected
13:58:13.867 -> test

So you see it is basically not doing anything anymore after the GET command.

If i do the SAME exact code and now just change port to 80 and use the non ssl lib, it works.

14:01:30.686 -> Starting Arduino web client.
14:01:45.113 -> connecting...
14:01:49.533 -> connected
14:01:49.580 -> test
14:01:49.627 -> test2
14:01:49.768 -> test3
14:01:49.861 -> finally
14:02:00.116 -> HTTP/1.1 200 OK
14:02:00.116 -> Server: nginx/1.10.3
14:02:00.116 -> Content-Type: text/plain; charset=UTF-8
14:02:00.350 -> Transfer-Encoding: chunked
14:02:00.819 -> Connection: close
14:02:00.819 -> Vary: Accept-Encoding
14:02:02.053 -> X-Request-Id: 989ce15e-549b-4614-8f71-c1ff4524f591
14:02:04.021 -> X-Token-Id: 592ad91d-b3a2-4d6b-9b3f-0733a8159089
14:02:04.256 -> Cache-Control: no-cache, private
14:02:04.256 -> Date: Sun, 28 Apr 2019 12:01:57 GMT
14:02:04.505 -> X-RateLimit-Limit: 30
14:02:04.633 -> X-RateLimit-Remaining: 29
14:02:04.633 -> 
14:02:04.633 -> 0
14:02:04.633 ->

Also it seems to be much faster. Do you have any idea what is going on here? I even tried to use the RAW AT commands inspired by this script here (https://github.com/telstra/arduino-mkr-nb-1500-cumulocity/blob/master/send_measurements/send_measurements.ino). Not working as well unfortunately. Also by using AT commands i was able to confirm that your library is actually successfully loading the root certificats into the modem.

I'm using the latest versions of everything as of today. Really glad for every tip you can give.

Some more debug infos:

  • i'm using the mkrnb1500 board
  • it has the ubox sara-r401m modem
  • using the https://1nce.com/ sim card from Telecom Germany with LTE-NB on band 800mhz (i think the underlying infrastructure is correct, as i can use http and everything works.)
  • external power is connected (otherwise only usb does not seem to provide enough power and modem will not work)

@sandeepmistry
Copy link
Contributor

If you change the NB nbAccess; of the sketch to NB nbAccess(true); we can get some more debug input.

What I suspect is happening is the SSL connection is failing and .connect(...) returns 2 instead of 1, this is a port over from the original GSM library. However, this seems not inline with the Client API spec.

@cmaglie @facchinm I'll prepare a pull request to change the return value to 0 on failure.

@sandeepmistry
Copy link
Contributor

Please ignore my previous comment, as it only applies to the MKR GSM lib.

@eikaramba if you can provide some debug logs as I indicated above that would be great.

@sandeepmistry
Copy link
Contributor

@eikaramba I've tried the following sketch on two of my boards, and all looks fine:

/*
  SSL Web client

 This sketch connects to a website using SSL through a MKR NB 1500 board. Specifically,
 this example downloads the URL "https://www.arduino.cc/asciilogo.txt" and
 prints it to the Serial monitor.

 Circuit:
 * MKR NB 1500 board
 * Antenna
 * SIM card with a data plan

 created 8 Mar 2012
 by Tom Igoe
*/

// libraries
#include <MKRNB.h>

#include "arduino_secrets.h" 
// Please enter your sensitive data in the Secret tab or arduino_secrets.h
// PIN Number
const char PINNUMBER[]     = SECRET_PINNUMBER;

// initialize the library instance
NBSSLClient client;
GPRS gprs;
NB nbAccess;

// URL, path and port (for example: arduino.cc)
char server[] = "webhook.site";
char path[] = "/";
int port = 443; // port 443 is the default for HTTPS

void setup() {
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Serial.println("Starting Arduino web client.");
  // connection state
  boolean connected = false;

  // After starting the modem with NB.begin()
  // attach to the GPRS network with the APN, login and password
  while (!connected) {
    if ((nbAccess.begin(PINNUMBER) == NB_READY) &&
        (gprs.attachGPRS() == GPRS_READY)) {
      connected = true;
    } else {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, port)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.print("GET ");
    client.print(path);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(server);
    client.println("Connection: close");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop() {
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.available() && !client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

    // do nothing forevermore:
    for (;;)
      ;
  }
}

Here's the output on the Serial monitor:

Starting Arduino web client.
connecting...
connected
HTTP/1.1 200 OK
Server: nginx/1.10.3
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
Cache-Control: no-cache, private
Date: Fri, 03 May 2019 15:15:31 GMT

1f78
<!DOCTYPE html>
<html ng-app="app" ng-controller="AppController">
<head>
    <title>Webhook.site - The Webhook Tester</title>

    <script>
        window.AppConfig = {
            Title: "Webhook.site - The Webhook Tester",
            Broadcaster: "socket.io",
            EchoHostMode: "path",
            PusherToken: "",
            MaxRequests: 500,
            StripeKey: "",
        };
    </script>

    <link href="css/app.css" rel="stylesheet">
    <script src="js/libs.js"></script>
    <script src="js/bundle.js"></script>
    <script async defer src="https://buttons.github.io/buttons.js"></script>

    <meta name="description"
          content="Instantly test, bin and log webhooks and HTTP requests with this handy tool that shows requests to a unique URL in realtime.">
</head>
<body ng-cloak>
<div class="mainView" ui-view>
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                        aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/" ui-sref="home()">
                    <img src="/icon.png" style="display:inline; width: 22px; height: 22px">
                    Webhook.site</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <div class="nav navbar-left navbar-form">
                    <a href="https://github.com/fredsted/webhook.site" target="_blank"
                       style="margin-top: 7px"
                       class="btn btn-xs btn-link">
                        Github Page</a>
                    <a href="https://github.com/fredsted/webhook.site#donate" target="_blank"
                       style="margin-top: 7px"
                       class="btn btn-xs btn-link">
                        Donate</a>
                    <a href="https://twitter.com/fredsted" target="_blank"
                       style="margin-top: 7px"
                       class="btn btn-xs btn-link">
                        @fredsted</a>
                    <a href="/terms" target="_blank"
                       style="margin-top: 7px"
                       class="btn btn-xs btn-link">
                        Terms &amp; Privacy</a>
                </div>
                <div class="nav navbar-right navbar-form hidden-sm">&nbsp;
                    <button type="button" class="btn btn-link openModal" data-modal="#editUrlModal"
                            ga-on="click" ga-event-category="Request" ga-event-action="click-newurl">
                    <span class="glyphicon glyphicon-edit"></span> Edit
                    </button> &nbsp;
                    <div class="form-group">
                        <input id="tokenUrl" type="text" class="form-control click-select"
                               style="width: 200px;"
                               value="{{ protocol }}//{{ domain }}/{{ token.uuid }}">
                    </div>
                    <button class="btn btn-success copyTokenUrl" data-clipboard-target="#tokenUrl"
                            ga-on="click" ga-event-category="URLCopy" ga-event-action="copy-nav">
                        <span class="glyphicon glyphicon-copy"></span> Copy
                    </button> &nbsp;
                    <button type="button" class="btn btn-primary openModal" data-modal="#newUrlModal"
                            ga-on="click" ga-event-category="Request" ga-event-action="click-editurl">
                        <span class="glyphicon glyphicon-plus"></span> New
                    </button>

                </div>
            </div>
        </div>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 col-md-2 sidebar" style="bottom: 40px">
                <p class="sidebar-header">Requests ({{ requests.total || 0 }})</p>
                <p ng-show="!hasRequests" class="small" style="padding-top: 20px">
                    <img src="assets/images/loader.gif"/>
                    &nbsp; Waiting for first request...
                </p>

                <div>
                    <ul class="nav nav-sidebar">
                        <li ng-show="hasRequests && currentPage > 1 && requests.total > requests.data.length && requests.current_page != 1 && requests.to != requests.data.length">
                            <a ng-click="getPreviousPage(token.uuid)" class="prevent-default">Previous Page</a>
                        </li>
                        <li ng-repeat="(key, request) in requests.data"
                            ng-class="{'active': currentRequestIndex === request.uuid, 'unread': unread.indexOf(request.uuid) !== -1}">
                            <a ng-click="setCurrentRequest(request)" class="select">
                                <span class="label label-{{ getLabel(request.method) }}">{{ request.method }}</span>
                                #{{ request.uuid.substring(0,5) }} {{ request.ip }} <br/>
                                <small>{{ request.created_at }}</small>
                            </a>
                            <a ng-click="deleteRequest(request, key)" class="btn btn-danger delete">
                                X
                            </a>
                        </li>
                        <li ng-show="hasRequests && !requests.is_last_page">
                            <a ng-click="getNextPage(token.uuid)" class="prevent-default">Next page</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-3 col-md-2 sidebar"
                 style="margin-top: 10px; height: 40px; bottom: 0px; top: auto; padding: 10px 0 0 0">
                <div class="text-center" ng-show="hasRequests">
                    <button
                            class="btn btn-xs btn-danger"
                            ng-click="deleteAllRequests(currentRequest)">Delete all requests
                    </button>
                </div>
            </div>
            <div id="request" class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <div id="rate-limit-warning"
                     class="alert alert-warning"
                     ng-show="hasRequests && requests.total >= appConfig.MaxRequests">
                    <p><strong>This URL received over {{ appConfig.MaxRequests }} requests and can't accept more
                            webhooks.</strong></p>
                    <p>New requests sent to this URL will return HTTP status code 410 Gone and
                        won't be logged. Please create a new URL to continue.</p>
                </div>
                <div id="tutorial" ng-show="!hasRequests || !hideTutorial">
                    <button type="button" class="close" data-dismiss="tutorial" aria-label="Close"
                            ng-click="toggleTutorial()">
                        <span aria-hidden="true">&times;</span></button>
                    <p><strong>Webhook.site</strong>
                        allows you to easily test webhooks and other types of HTTP requests.
                        <a href="https://simonfredsted.com/1583" target="_blank">What is a webhook?</a></p>
                    <p>Any requests sent to that URL are logged here instantly
                        &mdash; you don't even have to refresh!</p>
                    <hr>
                    <p>Here's your unique URL that was created just now:</p>
                    <p>
                        <code>{{ protocol }}//{{ domain }}/{{ token.uuid }}</code>
                        <a class="btn btn-xs btn-link copyTokenUrl" data-clipboard-target="#tokenUrl"
        
2000
                   ga-on="click" ga-event-category="URLCopy" ga-event-action="copy-welcome">
                            <span class="glyphicon glyphicon-copy"></span> Copy to clipboard</a>
                        <a class="btn btn-xs btn-link"
                           href="{{ protocol }}//{{ domain }}/{{ token.uuid }}"
                           target="_blank">
                            <span class="glyphicon glyphicon-new-window"></span> Open in new tab</a>
                    </p>
                    <hr>
                    <p>Bookmark this page to go back to the requests at any time.</p>
                    <p></p>Click <b>New URL</b> to create a new url with the ability to
                        customize status code, response body, etc.</p>
                    <p>
                        <a class="github-button" href="https://github.com/fredsted/webhook.site"
                           data-icon="octicon-star" data-show-count="true"
                           aria-label="Star fredsted/webhook.site on GitHub">Star on GitHub</a>
                        <a href="https://github.com/fredsted/webhook.site"
                    </p>
                </div>
                <div ng-show="hasRequests">
                    <div class="container-fluid">
                        <div class="row controls">
                            <div class="controlsNav">
                                <a class="btn btn-xs btn-link"
                                   ng-click="setCurrentRequest(requests.data[0])"
                                   ng-class="requests.data.indexOf(currentRequest) !== 0 ? '' : 'disabled'">
                                    First</a>
                                <a class="btn btn-xs btn-link"
                                   ng-class="requests.data.indexOf(currentRequest) <= requests.data.length && requests.data.indexOf(currentRequest) !== 0 ? '' : 'disabled'"
                                   ng-click="setCurrentRequest(requests.data[requests.data.indexOf(currentRequest) - 1])">
                                    &leftarrow; Previous</a>
                                <a class="btn btn-xs btn-link"
                                   ng-class="requests.data.indexOf(currentRequest) !== requests.data.length-1 ? '' : 'disabled'"
                                   ng-click="setCurrentRequest(requests.data[requests.data.indexOf(currentRequest) + 1])">
                                    Next &rightarrow;</a>
                                <a class="btn btn-xs btn-link"
                                   ng-class="requests.data.indexOf(currentRequest) !== requests.data.length-1 ? '' : 'disabled'"
                                   ng-click="setCurrentRequest(requests.data[requests.data.length-1])">
                                    Last</a>

                                <span class="vertSpacer" ng-hide="token.premium">|</span>

                                <!-- Requests Left -->
                                <span class="small" ng-hide="token.premium">
                                    {{ appConfig.MaxRequests - requests.total }} requests left
                                </span>

                                <span class="vertSpacer">|</span>

                                <!-- Premium -->
                                <span class="small label label-info"
                                      title="Expires {{ token.premium_expires_at_human }}" ng-show="token.premium">&check; Premium</span>

                                <a class="btn btn-xs openModal" data-modal="#premiumModal"
                                   ng-hide="token.premium"
                                   ga-on="click" ga-event-category="Premium" ga-event-action="upgrade"><strong>Unlock features - Log in with Patreon</strong></a>
                            </div>
                            <div class="controlsActions">
                                <!-- Password -->
                                <a href class="btn btn-xs" ng-class="!token.premium ? 'premiumLimited' : ''"
                                   ga-on="click" ga-event-category="Password" ng-disabled="!token.premium"
                                   ga-event-action="set" ng-click="setPassword()"
                                   title="[Premium] Require a password to see the requests"
                                   data-toggle="{{ !token.premium ? 'tooltip' : '' }}" data-placement="bottom">
                                    Set Password</a>

                                <span class="vertSpacer">|</span>

                                <!-- Server Redirection -->
                                <label class="small" title="[Premium] Redirect incoming requests to another URL, serverside"
                                       ng-disabled="!token.premium" data-placement="bottom" data-toggle="{{ !token.premium ? 'tooltip' : '' }}">
                                    <input type="checkbox" ng-model="token.redirect" ng-class="!token.premium ? 'disabled' : ''"
                                           ga-on="click" ga-event-category="ServerRedirect" ga-event-action="settings"
                                           ng-change="toggleServerRedirect()"
                                           ng-disabled="!redirects.data || !token.premium"
                                    />
                                    Server Redirect
                                </label>

                                <a href class="openModal btn btn-xs" data-modal="#serverRedirectModal" ng-click="getRedirects()"
                                   ga-on="click" ga-event-category="ServerRedirect" ng-disabled="!token.premium"
                                   ga-event-action="settings"
                                   title="[Premium] Redirect incoming requests to another URL, serverside"
                                   data-toggle="{{ !token.premium ? 'tooltip' : '' }}" data-placement="bottom">
                                    Settings...</a>

                                <a ng-click="serverRedirect(currentRequest)"
                                   class="btn btn-xs" ng-class="redirects.data.length > 0 ? '' : 'disabled'"
                                   ng-disabled="!token.premium || !redirects.data"
                                   ga-on="click" ga-event-category="ServerRedirect" ga-event-action="server-redir-now">
                                    Redirect Now</a>

                                <span class="vertSpacer">|</span>

                                <!-- Redirection -->
                                <label class="small" title="Redirect incoming requests to another URL via XHR">
                                    <input type="checkbox" ng-model="redirectEnable"
                                           ng-disabled="!redirectUrl"
                                           ga-on="click" ga-event-category="AutoRedirect" ga-event-action="toggle"/>
                                    XHR Redirect
                                </label>
                                <a href class="openModal btn btn-xs" data-modal="#redirectModal"
                                   ga-on="click" ga-event-category="AutoRedirect"
                                   ga-event-action="settings">Settings...</a>
                                <a ng-click="redirect(currentRequest, redirectUrl, redirectMethod, redirectContentType)"
                                   class="btn btn-xs" ng-class="redirectUrl ? '' : 'disabled'"
                                   ga-on="click" ga-event-category="AutoRedirect" ga-event-action="redir-now">Redirect
                                    Now</a>

                                <span class="vertSpacer">|</span>

                                <!-- Auto-JSON -->
                                <label class="small"
                                       title="Automatically applies easy to read JSON formatting on valid requests">
                                    <input type="checkbox" ng-model="formatJsonEnable"
                                           ga-on="click" ga-event-category="JSONFormat" ga-event-action="toggle
2000
"/>
                                    Format JSON</label>

                                <span class="vertSpacer">|</span>

                                <!-- Auto Navigate -->
                                <label class="small"
                                       title="Automatically select and go to the latest incoming webhook request">
                                    <input type="checkbox" ng-model="autoNavEnable"
                                           ga-on="click" ga-event-category="AutoNav" ga-event-action="toggle"/> Auto
                                    Navigate</label>

                                <span class="vertSpacer">|</span>

                                <label class="small"><input type="checkbox" ng-model="hideDetails">
                                    Hide Details</label>
                            </div>
                        </div>
                        <div class="row" id="requestDetails" ng-show="!hideDetails">
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colspan="2">
                                            Request Details
                                            <span class="pull-right">
                                                <a class="small"
                                                   href="{{ protocol }}//{{ domain }}/#/{{ token.uuid }}/{{ currentRequestIndex }}/{{ currentPage }}">
                                                    permalink</a> &ensp;
                                                <a class="small" target="_blank"
                                                   href="{{ protocol }}//{{ domain }}/token/{{ token.uuid }}/request/{{ currentRequest.uuid }}/raw">
                                                raw</a>
                                            </span>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td width="15%">
                                            <span class="label label-{{ getLabel(currentRequest.method) }}">{{ currentRequest.method }}</span>
                                        </td>
                                        <td id="req-url" class="break">
                                            <a href="{{ currentRequest.url }}">{{ currentRequest.url }}</a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Host</td>
                                        <td id="req-ip">
                                            {{ currentRequest.ip }}
                                            <a class="small" target="_blank"
                                               href="https://who.is/whois-ip/ip-address/{{ currentRequest.ip }}">whois</a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Date</td>
                                        <td id="req-date">{{ currentRequest.created_at }}</td>
                                    </tr>
                                    <tr>
                                        <td>ID</td>
                                        <td id="req-date">{{ currentRequest.uuid }}</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colspan="2">Headers</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="(headerName, values) in currentRequest.headers">
                                        <td width="25%">{{ headerName }}</td>
                                        <td><code ng-repeat="value in values">
                                                {{ value === '' ? '(empty)' : value }}{{ $last ? '' : ', ' }}</code>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row" id="requestData" ng-show="!hideDetails">
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colspan="2">Query strings</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-show="!currentRequest.query">
                                        <td><span class="small">(empty)</span></td>
                                    </tr>
                                    <tr ng-repeat="(name, value) in currentRequest.query">
                                        <td width="25%" class="break">{{ name }}</td>
                                        <td class="break"><code>{{ value === '' ? '(empty)' : value }}</code></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colspan="2">Form values</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-show="!currentRequest.request">
                                        <td><span class="small">(empty)</span></td>
                                    </tr>
                                    <tr ng-repeat="(name, value) in currentRequest.request">
                                        <td class="break" width="25%">{{ name }}</td>
                                        <td class="break"><code>{{ value === '' ? '(empty)' : value }}</code></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-12">
                                <p id="noContent" ng-show="hasRequests && currentRequest.content == ''">
                                    (no body content)</p>

                                <pre id="req-content"
                                     ng-show="hasRequests && currentRequest.content != ''"
                                     ng-bind="formatJsonEnable ? formatContentJson(currentRequest.content) : currentRequest.content">
                                </pre>
                            </div>
                        </div>

                        <div class="row redirectResponse" ng-repeat="(id, response) in redirectResponses[currentRequest.uuid].data">
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colsp
2000
an="2">Redirect Response #{{ response.uuid.substring(0,5) }}</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>URL</td>
                                            <td>{{ response.url }}</td>
                                        </tr>
                                        <tr>
                                            <td>Status code</td>
                                            <td>{{ response.status }}</td>
                                        </tr>
                                        <tr>
                                            <td>Date</td>
                                            <td>{{ response.created_at }}</td>
                                        </tr>
                                    </tbody>
                                </table>

                                <p id="noContent" ng-show="response.content == ''">
                                    (no body content)</p>
                                <pre ng-bind="formatJsonEnable ? formatContentJson(response.content) : response.content"
                                     ng-show="response.content != ''"></pre>
                            </div>
                            <div class="col-md-6">
                                <table class="table table-borderless table-striped">
                                    <thead>
                                    <tr>
                                        <th colspan="2">Headers</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="(headerName, values) in response.headers">
                                        <td width="25%" class="break">{{ headerName }}</td>
                                        <td class="break"><code ng-repeat="value in values">
                                                {{ value === '' ? '(empty)' : value }}{{ $last ? '' : ', ' }}</code>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" tabindex="-1" role="dialog" id="redirectModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Configure XHR Redirect</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="redirectForm">
                        <fieldset>
                            <div class="form-group">
                                <div class="container-fluid">
                                    <p>Redirection allows you to automatically, or with a click, send incoming
                                        requests to another URL via XHR. The content will be redirected, and you can
                                        choose
                                        a static method to use.</p>
                                    <p>Headers to be passed along can be provided as a comma-separated list. Be sure
                                        to ensure these headers are allowed in any security settings (Cross-Domain)</p>
                                    <p>Since XHR is used, there might be issues with Cross-Domain Requests.</p>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-4 control-label" for="redirectUrl">Redirect to</label>
                                <div class="col-md-7">
                                    <input id="redirectUrl" ng-model="redirectUrl"
                                           placeholder="http://localhost"
                                           class="form-control input-md">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-4 control-label" for="redirectContentType">Content Type</label>
                                <div class="col-md-7">
                                    <input id="redirectContentType" ng-model="redirectContentType"
                                           class="form-control input-md">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-4 control-label" for="redirectHeaders">Redirect Headers</label>
                                <div class="col-md-7">
                                    <input id="redirectHeaders" ng-model="redirectHeaders"
                                           placeholder="e.g. x-token,referer"
                                           class="form-control input-md">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-4 control-label" for="redirectUrl">HTTP Method</label>
                                <div class="col-md-5">
                                    <select class="form-control input-md" ng-model="redirectMethod">
                                        <option value="">Default (use request method)</option>
                                        <option value="GET">GET</option>
                                        <option value="POST">POST</option>
                                        <option value="PUT">PUT</option>
                                        <option value="DELETE">DELETE</option>
                                        <option value="PATCH">PATCH</option>
                                    </select>
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" ng-click="saveSettings()" data-dismiss="modal">Close
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" tabindex="-1" role="dialog" id="editUrlModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Edit URL</h4>
                </div>
                <div class="modal-body">
                    <div id="rate-limit-warning"
                         class="alert alert-warning"
                         ng-show="token === null">
                        <p>This URL could not be found. It might have been automatically deleted.<br/>
                            Please create a new URL.</p>
                    </div>
                    <form class="form-horizontal" id="editTokenForm">
                        <fieldset>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_status">Default status code</label>
                                <div class="col-md-4">
                                    <input id="default_status" name="default_status" type="text" placeholder="200"
     
2000
                                      class="form-control input-md" ng-model="token.default_status">

                                </div>
                            </div>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_content_type">Content Type</label>
                                <div class="col-md-4">
                                    <input id="default_content_type" name="default_content_type" type="text"
                                           placeholder="text/plain" class="form-control input-md"
                                           ng-model="token.default_content_type">
                                </div>
                            </div>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="timeout">Timeout before response</label>
                                <div class="col-md-4">
                                    <input id="timeout" name="timeout" type="number" max="10" min="0" placeholder="0"
                                           value="0" class="form-control input-md"
                                           ng-model="token.timeout">
                                </div>
                            </div>

                            <!-- Textarea -->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_content">Response body</label>
                                <div class="col-md-7">
                                    <textarea class="form-control" id="default_content" name="default_content"
                                              rows="5" ng-model="token.default_content"></textarea>
                                </div>
                            </div>

                        </fieldset>
                    </form>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal"
                            ng-click="editToken(token.uuid)"
                            ga-on="click" ga-event-category="Request" ga-event-action="create">
                        Edit
                    </button>
                </div>


            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" tabindex="-1" role="dialog" id="newUrlModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Create New URL</h4>
                </div>
                <div class="modal-body">
                    <div id="rate-limit-warning"
                         class="alert alert-warning"
                         ng-show="token === null">
                        <p>This URL could not be found. It might have been automatically deleted.<br/>
                            Please create a new URL.</p>
                    </div>
                    <p>You have the ability to customize how your URL will respond by changing the
                        status code, content-type header and the content.</p>
                    <hr>
                    <form class="form-horizontal" id="createTokenForm">
                        <fieldset>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_status">Default status code</label>
                                <div class="col-md-4">
                                    <input id="default_status" name="default_status" type="text" placeholder="200"
                                           class="form-control input-md">

                                </div>
                            </div>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_content_type">Content Type</label>
                                <div class="col-md-4">
                                    <input id="default_content_type" name="default_content_type" type="text"
                                           placeholder="text/plain" class="form-control input-md">
                                </div>
                            </div>

                            <!-- Text input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="timeout">Timeout before response</label>
                                <div class="col-md-4">
                                    <input id="timeout" name="timeout" type="number" max="10" min="0" placeholder="0"
                                           value="0" class="form-control input-md">
                                </div>
                            </div>

                            <!-- Textarea -->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="default_content">Response body</label>
                                <div class="col-md-7">
                                    <textarea class="form-control" id="default_content" name="default_content"
                                              rows="5"></textarea>
                                </div>
                            </div>

                        </fieldset>
                    </form>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="getCustomToken()"
                            ga-on="click" ga-event-category="Request" ga-event-action="create">
                        Create
                    </button>
                </div>


            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" tabindex="-1" role="dialog" id="premiumModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Webhook.site Premium</h4>
                </div>
                <div class="modal-body">
                    <p>
                        It takes time and money to run &amp; develop a service like Webhook.site. Many hundreds of thousands
                        of requests are handled daily, and that takes both time and server power, which is not cheap.
                    </p>
                    <p>
                        By upgrading a URL to premium, you not only support webhook.site, but also unlock
                        additional features:
                    </p>
                    <ul>
                        <li>Upgrade unlimited URLs!</li>
                        <li>Unlimited Requests <span class="text-muted small">(fair usage applies&mdash;see terms)</span></li>
                        <li>Server-side Redirects</li>
                        <li>Password Protection</li>
                    </ul>
                    <p>
                        By buying a premium upgrade, you are agreeing to and have read
                        the <a href="/terms">Terms and Conditions</a>.</p>

                    <p class="text-center">
                        <a class="btn btn-primary" id="btnUpgrade" data-dismiss="modal"
                           ng-click="patreonLogin()">Become a Patron &amp; Upgrade</a>
                    </p>
    
d3b
                <!-- <p>Read my blog post about <a href="https://simonfredsted.com/2392">Webhook.site Premium.</a></p> -->
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" tabindex="-1" role="dialog" id="serverRedirectModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Configure Server-Side Redirects</h4>
                </div>
                <div class="modal-body">
                    <p>On an incoming request, or with a click, you can redirect requests to another endpoint.
                    Server redirects happen server-side, not in your browser, so redirects happen even when the browser window is closed.</p>

                    <table class="table table-borderless" id="redirectsTable" style="margin-bottom: 0">
                        <tr ng-repeat="redirect in redirects.data">
                            <td class="break col-md-10" style="max-width:360px; vertical-align: middle">
                                <code>{{ redirect.url }}</code>
                            </td>
                            <td class="col-md-2">
                                <a class="btn btn-block btn-sm btn-danger" href="#"
                                   ng-click="deleteRedirect(token.uuid, redirect.uuid)">Remove</a>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-md-10">
                                <input id="serverRedirectUrl" name="serverRedirectUrl" type="text" ng-model="serverRedirectUrl"
                                       placeholder="https://example.com/webhook" class="form-control input-sm"
                                       ng-keyup="$event.keyCode == 13 && addRedirect(token.uuid, serverRedirectUrl)">
                            </td>
                            <td class="col-md-2">
                                <button class="btn btn-block btn-sm btn-primary" ng-click="addRedirect(token.uuid, serverRedirectUrl)">Add</button>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <script type="application/javascript">
        window.ga = window.ga || function () {
            (ga.q = ga.q || []).push(arguments)
        };
        ga.l = +new Date;
        ga('create', 'UA-5230636-9', 'auto');
        ga('require', 'eventTracker');
        ga('require', 'outboundLinkTracker');
        ga('require', 'urlChangeTracker');
        ga('require', 'pageVisibilityTracker');
        ga('send', 'pageview');
    </script>
    <script async src="https://www.google-analytics.com/analytics.js"></script>
    <script async src="assets/scripts/libs/autotrack.js"></script>
</div>
</body>
</html>

0


disconnecting.

@eikaramba
Copy link
Author

eikaramba commented May 6, 2019

thanks for your help. i activated the debug mode and got the following. seems there is a problem with connecting to the server via socket?

23:26:18.496 -> Starting Arduino web client.
23:26:18.599 -> AT

23:26:18.599 -> OK
23:26:18.734 -> AT+CFUN=0

23:26:18.734 -> OK
23:26:18.940 -> AT+CGATT=0

23:26:18.940 -> OK
23:26:19.143 -> AT+CPIN?

23:26:19.143 -> +CPIN: READY
23:26:19.143 -> 
23:26:19.143 -> OK
23:26:19.347 -> AT+CMGF=1

23:26:19.347 -> OK
23:26:19.550 -> AT+UDCONF=1,1

23:26:19.550 -> OK
23:26:19.753 -> AT+CTZU=1

23:26:19.753 -> OK
23:26:19.955 -> AT+CGDCONT=1,"IP",""

23:26:19.955 -> OK
23:26:20.158 -> AT+CFUN=1

23:26:20.158 -> OK
23:26:20.362 -> AT+CEREG?

23:26:20.362 -> +CEREG: 0,0
23:26:20.362 -> 
23:26:20.362 -> OK
23:26:20.566 -> AT+CEREG?

23:26:20.566 -> +CEREG: 0,0
23:26:20.566 -> 
23:26:20.566 -> OK
23:26:20.766 -> AT+CEREG?

23:26:20.766 -> +CEREG: 0,0
23:26:20.766 -> 
23:26:20.766 -> OK
23:26:20.969 -> AT+CEREG?

23:26:20.969 -> +CEREG: 0,0
23:26:20.969 -> 
23:26:20.969 -> OK
23:26:21.170 -> AT+CEREG?

23:26:21.170 -> +CEREG: 0,0
23:26:21.170 -> 
23:26:21.170 -> OK
23:26:21.373 -> AT+CEREG?

23:26:21.373 -> +CEREG: 0,0
23:26:21.373 -> 
23:26:21.373 -> OK
23:26:21.576 -> AT+CEREG?

23:26:21.576 -> +CEREG: 0,0
23:26:21.576 -> 
23:26:21.576 -> OK
23:26:21.775 -> AT+CEREG?

23:26:21.775 -> +CEREG: 0,0
23:26:21.775 -> 
23:26:21.775 -> OK
23:26:21.978 -> AT+CEREG?

23:26:21.978 -> +CEREG: 0,0
23:26:21.978 -> 
23:26:21.978 -> OK
23:26:22.180 -> AT+CEREG?

23:26:22.180 -> +CEREG: 0,0
23:26:22.180 -> 
23:26:22.180 -> OK
23:26:22.385 -> AT+CEREG?

23:26:22.385 -> +CEREG: 0,0
23:26:22.385 -> 
23:26:22.385 -> OK
23:26:22.587 -> AT+CEREG?

23:26:22.587 -> +CEREG: 0,0
23:26:22.587 -> 
23:26:22.587 -> OK
23:26:22.789 -> AT+CEREG?

23:26:22.789 -> +CEREG: 0,0
23:26:22.789 -> 
23:26:22.789 -> OK
23:26:22.989 -> AT+CEREG?

23:26:22.989 -> +CEREG: 0,0
23:26:22.989 -> 
23:26:22.989 -> OK
23:26:23.191 -> AT+CEREG?

23:26:23.191 -> +CEREG: 0,0
23:26:23.224 -> 
23:26:23.224 -> OK
23:26:23.394 -> AT+CEREG?

23:26:23.427 -> +CEREG: 0,0
23:26:23.427 -> 
23:26:23.427 -> OK
23:26:23.630 -> AT+CEREG?

23:26:23.630 -> +CEREG: 0,0
23:26:23.630 -> 
23:26:23.630 -> OK
23:26:23.833 -> AT+CEREG?

23:26:23.833 -> +CEREG: 0,0
23:26:23.833 -> 
23:26:23.833 -> OK
23:26:24.036 -> AT+CEREG?

23:26:24.036 -> +CEREG: 0,0
23:26:24.036 -> 
23:26:24.036 -> OK
23:26:24.239 -> AT+CEREG?

23:26:24.239 -> +CEREG: 0,0
23:26:24.239 -> 
23:26:24.239 -> OK
23:26:24.442 -> AT+CEREG?

23:26:24.442 -> +CEREG: 0,0
23:26:24.442 -> 
23:26:24.442 -> OK
23:26:24.643 -> AT+CEREG?

23:26:24.643 -> +CEREG: 0,0
23:26:24.643 -> 
23:26:24.643 -> OK
23:26:24.848 -> AT+CEREG?

23:26:24.848 -> +CEREG: 0,0
23:26:24.848 -> 
23:26:24.848 -> OK
23:26:25.055 -> AT+CEREG?

23:26:25.055 -> +CEREG: 0,0
23:26:25.055 -> 
23:26:25.055 -> OK
23:26:25.228 -> AT+CEREG?

23:26:25.228 -> +CEREG: 0,0
23:26:25.228 -> 
23:26:25.228 -> OK
23:26:25.432 -> AT+CEREG?

23:26:25.432 -> +CEREG: 0,0
23:26:25.432 -> 
23:26:25.432 -> OK
23:26:25.634 -> AT+CEREG?

23:26:25.634 -> +CEREG: 0,0
23:26:25.634 -> 
23:26:25.634 -> OK
23:26:25.835 -> AT+CEREG?

23:26:25.870 -> +CEREG: 0,0
23:26:25.870 -> 
23:26:25.870 -> OK
23:26:26.039 -> AT+CEREG?

23:26:26.073 -> +CEREG: 0,0
23:26:26.073 -> 
23:26:26.073 -> OK
23:26:26.244 -> AT+CEREG?

23:26:26.244 -> +CEREG: 0,0
23:26:26.277 -> 
23:26:26.277 -> OK
23:26:26.449 -> AT+CEREG?

23:26:26.449 -> +CEREG: 0,0
23:26:26.449 -> 
23:26:26.449 -> OK
23:26:26.652 -> AT+CEREG?

23:26:26.652 -> +CEREG: 0,0
23:26:26.652 -> 
23:26:26.652 -> OK
23:26:26.855 -> AT+CEREG?

23:26:26.855 -> +CEREG: 0,0
23:26:26.855 -> 
23:26:26.855 -> OK
23:26:27.088 -> AT+CEREG?

23:26:27.088 -> +CEREG: 0,0
23:26:27.088 -> 
23:26:27.088 -> OK
23:26:27.291 -> AT+CEREG?

23:26:27.291 -> +CEREG: 0,0
23:26:27.291 -> 
23:26:27.291 -> OK
23:26:27.495 -> AT+CEREG?

23:26:27.495 -> +CEREG: 0,0
23:26:27.495 -> 
23:26:27.495 -> OK
23:26:27.696 -> AT+CEREG?

23:26:27.696 -> +CEREG: 0,5
23:26:27.696 -> 
23:26:27.696 -> OK
23:26:28.202 -> AT+CGATT=1

23:26:28.202 -> OK
23:26:29.211 -> AT+CGACT?

23:26:29.211 -> +CGACT: 1,1
23:26:29.211 -> 
23:26:29.211 -> OK
23:26:29.211 -> connecting...
23:26:29.244 -> AT+USECMNG=0,0,"AddTrust_External_CA_Root",1082

23:26:29.244 -> >
23:26:29.447 -> +USECMNG: 0,0,"AddTrust_External_CA_Root","1D3554048578B03F42424DBF20730A3F"
23:26:29.447 -> 
23:26:29.447 -> OK
23:26:29.481 -> AT+USECMNG=0,0,"Baltimore_CyberTrust_Root",891

23:26:29.481 -> >
23:26:29.649 -> +USECMNG: 0,0,"Baltimore_CyberTrust_Root","ACB694A59C17E0D791529BB19706A6E4"
23:26:29.649 -> 
23:26:29.649 -> OK
23:26:29.682 -> AT+USECMNG=0,0,"COMODO_RSA_Certification_Authority",1500

23:26:29.682 -> >
23:26:29.985 -> +USECMNG: 0,0,"COMODO_RSA_Certification_Authority","1B31B0714036CC143691ADC43EFDEC18"
23:26:29.985 -> 
23:26:29.985 -> OK
23:26:30.018 -> AT+USECMNG=0,0,"DST_Root_CA_X3",846

23:26:30.018 -> >
23:26:30.153 -> +USECMNG: 0,0,"DST_Root_CA_X3","410352DC0FF7501B16F0028EBA6F45C5"
23:26:30.186 -> 
23:26:30.186 -> OK
23:26:30.219 -> AT+USECMNG=0,0,"DigiCert_High_Assurance_EV_Root_CA",969

23:26:30.219 -> >
23:26:30.387 -> +USECMNG: 0,0,"DigiCert_High_Assurance_EV_Root_CA","D474DE575C39B2D39C8583C5C065498A"
23:26:30.387 -> 
23:26:30.387 -> OK
23:26:30.421 -> AT+USECMNG=0,0,"Entrust_Root_Certification_Authority",1173

23:26:30.421 -> >
23:26:30.656 -> +USECMNG: 0,0,"Entrust_Root_Certification_Authority","D6A5C3ED5DDD3E00C13D87921F1D3FE4"
23:26:30.656 -> 
23:26:30.656 -> OK
23:26:30.691 -> AT+USECMNG=0,0,"Equifax_Secure_Certificate_Authority",804

23:26:30.691 -> >
23:26:30.859 -> +USECMNG: 0,0,"Equifax_Secure_Certificate_Authority","67CB9DC013248A829BB2171ED11BECD4"
23:26:30.859 -> 
23:26:30.859 -> OK
23:26:30.892 -> AT+USECMNG=0,0,"GeoTrust_Global_CA",856

23:26:30.892 -> >
23:26:31.063 -> +USECMNG: 0,0,"GeoTrust_Global_CA","F775AB29FB514EB7775EFF053C998EF5"
23:26:31.063 -> 
23:26:31.063 -> OK
23:26:31.097 -> AT+USECMNG=0,0,"GeoTrust_Primary_Certification_Authority_G3",1026

23:26:31.097 -> >
23:26:31.301 -> +USECMNG: 0,0,"GeoTrust_Primary_Certification_Authority_G3","B5E83436C910445848706D2E83D4B805"
23:26:31.301 -> 
23:26:31.301 -> OK
23:26:31.336 -> AT+USECMNG=0,0,"GlobalSign",958

23:26:31.336 -> >
23:26:31.508 -> +USECMNG: 0,0,"GlobalSign","9414777E3E5EFD8F30BD41B0CFE7D030"
23:26:31.508 -> 
23:26:31.508 -> OK
23:26:31.542 -> AT+USECMNG=0,0,"Go_Daddy_Root_Certificate_Authority_G2",969

23:26:31.542 -> >
23:26:31.712 -> +USECMNG: 0,0,"Go_Daddy_Root_Certificate_Authority_G2","803ABC22C1E6FB8D9B3B274A321B9A01"
23:26:31.746 -> 
23:26:31.746 -> OK
23:26:31.746 -> AT+USECMNG=0,0,"VeriSign_Class_3_Public_Primary_Certification_Authority_G5",1239

23:26:31.781 -> >
23:26:31.985 -> +USECMNG: 0,0,"VeriSign_Class_3_Public_Primary_Certification_Authority_G5","CB17E431673EE209FE455793F30AFA1C"
23:26:32.019 -> 
23:26:32.019 -> OK
23:26:32.019 -> AT+USECMNG=0,0,"AmazonRootCA1",837

23:26:32.053 -> >
23:26:32.188 -> +USECMNG: 0,0,"AmazonRootCA1","43C6BFAEECFEAD2F18C6886830FCC8E6"
23:26:32.188 -> 
23:26:32.188 -> OK
23:26:32.325 -> AT+USOCR=6

23:26:32.325 -> +USOCR: 0
23:26:32.325 -> 
23:26:32.325 -> OK
23:26:32.532 -> AT+USOSEC=0,1,0

23:26:32.532 -> OK
23:26:32.736 -> AT+USECPRF=0,0,1

23:26:32.736 -> OK
23:26:32.940 -> AT+USOCO=0,"webhook.site",443

23:26:48.425 -> OK
23:26:48.425 -> connected
23:26:48.458 -> AT+USOWR=0,4,"47455420"

23:26:48.525 -> +CME ERROR: Operation not allowed
23:26:48.559 -> 
23:26:48.559 -> AT+USOCL=0
test
23:27:01.493 -> 
23:27:01.493 -> OK

For comparison i tried the same without SSL and got this:

23:29:08.302 -> Starting Arduino web client.
23:29:12.923 -> AT

23:29:12.923 -> OK
23:29:13.017 -> AT+CFUN=0

23:29:13.017 -> OK
23:29:13.204 -> AT+CGATT=0

23:29:13.252 -> OK
23:29:13.439 -> AT+CPIN?

23:29:13.439 -> +CPIN: READY
23:29:13.439 -> 
23:29:13.439 -> OK
23:29:13.614 -> AT+CMGF=1

23:29:13.614 -> OK
23:29:13.866 -> AT+UDCONF=1,1

23:29:13.866 -> OK
23:29:14.054 -> AT+CTZU=1

23:29:14.054 -> OK
23:29:14.241 -> AT+CGDCONT=1,"IP",""

23:29:14.241 -> OK
23:29:14.429 -> AT+CFUN=1

23:29:14.429 -> OK
23:29:14.663 -> AT+CEREG?

23:29:14.663 -> +CEREG: 0,0
23:29:14.663 -> 
23:29:14.663 -> OK
23:29:14.851 -> AT+CEREG?

23:29:14.851 -> +CEREG: 0,0
23:29:14.851 -> 
23:29:14.851 -> OK
23:29:15.038 -> AT+CEREG?

23:29:15.038 -> +CEREG: 0,0
23:29:15.038 -> 
23:29:15.038 -> OK
23:29:15.273 -> AT+CEREG?

23:29:15.273 -> +CEREG: 0,0
23:29:15.273 -> 
23:29:15.273 -> OK
23:29:15.460 -> AT+CEREG?

23:29:15.460 -> +CEREG: 0,0
23:29:15.460 -> 
23:29:15.460 -> OK
23:29:15.647 -> AT+CEREG?

23:29:15.647 -> +CEREG: 0,0
23:29:15.647 -> 
23:29:15.647 -> OK
23:29:15.882 -> AT+CEREG?

23:29:15.882 -> +CEREG: 0,0
23:29:15.882 -> 
23:29:15.882 -> OK
23:29:16.069 -> AT+CEREG?

23:29:16.069 -> +CEREG: 0,0
23:29:16.069 -> 
23:29:16.069 -> OK
23:29:16.257 -> AT+CEREG?

23:29:16.304 -> +CEREG: 0,0
23:29:16.304 -> 
23:29:16.304 -> OK
23:29:16.491 -> AT+CEREG?

23:29:16.491 -> +CEREG: 0,0
23:29:16.491 -> 
23:29:16.491 -> OK
23:29:16.679 -> AT+CEREG?

23:29:16.679 -> +CEREG: 0,0
23:29:16.679 -> 
23:29:16.679 -> OK
23:29:16.901 -> AT+CEREG?

23:29:16.901 -> +CEREG: 0,0
23:29:16.901 -> 
23:29:16.901 -> OK
23:29:17.075 -> AT+CEREG?

23:29:17.075 -> +CEREG: 0,0
23:29:17.075 -> 
23:29:17.075 -> OK
23:29:17.310 -> AT+CEREG?

23:29:17.310 -> +CEREG: 0,0
23:29:17.310 -> 
23:29:17.310 -> OK
23:29:17.497 -> AT+CEREG?

23:29:17.497 -> +CEREG: 0,0
23:29:17.497 -> 
23:29:17.497 -> OK
23:29:17.685 -> AT+CEREG?

23:29:17.685 -> +CEREG: 0,0
23:29:17.685 -> 
23:29:17.685 -> OK
23:29:17.919 -> AT+CEREG?

23:29:17.919 -> +CEREG: 0,0
23:29:17.919 -> 
23:29:17.919 -> OK
23:29:18.107 -> AT+CEREG?

23:29:18.107 -> +CEREG: 0,0
23:29:18.107 -> 
23:29:18.107 -> OK
23:29:18.294 -> AT+CEREG?

23:29:18.294 -> +CEREG: 0,0
23:29:18.341 -> 
23:29:18.341 -> OK
23:29:18.529 -> AT+CEREG?

23:29:18.529 -> +CEREG: 0,0
23:29:18.529 -> 
23:29:18.529 -> OK
23:29:18.703 -> AT+CEREG?

23:29:18.703 -> +CEREG: 0,0
23:29:18.703 -> 
23:29:18.703 -> OK
23:29:18.938 -> AT+CEREG?

23:29:18.938 -> +CEREG: 0,0
23:29:18.938 -> 
23:29:18.938 -> OK
23:29:19.125 -> AT+CEREG?

23:29:19.125 -> +CEREG: 0,0
23:29:19.125 -> 
23:29:19.125 -> OK
23:29:19.313 -> AT+CEREG?

23:29:19.346 -> +CEREG: 0,0
23:29:19.346 -> 
23:29:19.346 -> OK
23:29:19.533 -> AT+CEREG?

23:29:19.533 -> +CEREG: 0,0
23:29:19.533 -> 
23:29:19.533 -> OK
23:29:19.721 -> AT+CEREG?

23:29:19.768 -> +CEREG: 0,0
23:29:19.768 -> 
23:29:19.768 -> OK
23:29:19.956 -> AT+CEREG?

23:29:19.956 -> +CEREG: 0,0
23:29:19.956 -> 
23:29:19.956 -> OK
23:29:20.143 -> AT+CEREG?

23:29:20.143 -> +CEREG: 0,0
23:29:20.143 -> 
23:29:20.143 -> OK
23:29:20.371 -> AT+CEREG?

23:29:20.371 -> +CEREG: 0,0
23:29:20.371 -> 
23:29:20.371 -> OK
23:29:20.559 -> AT+CEREG?

23:29:20.559 -> +CEREG: 0,0
23:29:20.559 -> 
23:29:20.559 -> OK
23:29:20.780 -> AT+CEREG?

23:29:20.780 -> +CEREG: 0,0
23:29:20.780 -> 
23:29:20.780 -> OK
23:29:20.968 -> AT+CEREG?

23:29:20.968 -> +CEREG: 0,0
23:29:20.968 -> 
23:29:20.968 -> OK
23:29:21.155 -> AT+CEREG?

23:29:21.155 -> +CEREG: 0,0
23:29:21.155 -> 
23:29:21.155 -> OK
23:29:21.390 -> AT+CEREG?

23:29:21.390 -> +CEREG: 0,0
23:29:21.390 -> 
23:29:21.390 -> OK
23:29:21.577 -> AT+CEREG?

23:29:21.577 -> +CEREG: 0,0
23:29:21.577 -> 
23:29:21.577 -> OK
23:29:21.773 -> AT+CEREG?

23:29:21.773 -> +CEREG: 0,0
23:29:21.773 -> 
23:29:21.773 -> OK
23:29:22.007 -> AT+CEREG?

23:29:22.007 -> +CEREG: 0,5
23:29:22.007 -> 
23:29:22.007 -> OK
23:29:22.510 -> AT+CGATT=1

23:29:22.510 -> OK
23:29:23.491 -> AT+CGACT?

23:29:23.491 -> +CGACT: 1,1
23:29:23.491 -> 
23:29:23.491 -> OK
23:29:23.491 -> connecting...
23:29:23.631 -> AT+USOCR=6

23:29:23.631 -> +USOCR: 0
23:29:23.631 -> 
23:29:23.631 -> OK
23:29:23.819 -> AT+USOCO=0,"webhook.site",80

23:29:24.438 -> OK
23:29:24.438 -> connected
23:29:24.484 -> AT+USOWR=0,4,"47455420"

23:29:24.484 -> +USOWR: 0,4
23:29:24.484 -> 
23:29:24.484 -> OK
23:29:24.484 -> test
23:29:24.484 -> AT+USOWR=0,37,"2F35393261643931642D623361322D346436622D396233662D303733336138313539303839"

23:29:24.532 -> +USOWR: 0,37
23:29:24.532 -> 
23:29:24.532 -> OK
23:29:24.532 -> test2
23:29:24.532 -> AT+USOWR=0,9,"20485454502F312E31"

23:29:24.532 -> +USOWR: 0,9
23:29:24.532 -> 
23:29:24.532 -> OK
23:29:24.578 -> AT+USOWR=0,2,"0D0A"

23:29:24.578 -> +USOWR: 0,2
23:29:24.578 -> 
23:29:24.578 -> OK
23:29:24.578 -> AT+USOWR=0,6,"486F73743A20"

23:29:24.578 -> +USOWR: 0,6
23:29:24.578 -> 
23:29:24.578 -> OK
23:29:24.625 -> AT+USOWR=0,12,"776562686F6F6B2E73697465"

23:29:24.625 -> +USOWR: 0,12
23:29:24.625 -> 
23:29:24.625 -> OK
23:29:24.672 -> AT+USOWR=0,2,"0D0A"

23:29:24.672 -> +USOWR: 0,2
23:29:24.672 -> 
23:29:24.672 -> OK
23:29:24.672 -> test3
23:29:24.672 -> AT+USOWR=0,17,"436F6E6E656374696F6E3A20636C6F7365"

23:29:24.672 -> +USOWR: 0,17
23:29:24.672 -> 
23:29:24.672 -> OK
23:29:24.719 -> AT+USOWR=0,2,"0D0A"

23:29:24.719 -> +USOWR: 0,2
23:29:24.719 -> 
23:29:24.719 -> OK
23:29:24.766 -> AT+USOWR=0,2,"0D0A"

23:29:24.766 -> +USOWR: 0,2
23:29:24.766 -> 
23:29:24.766 -> OK
23:29:24.766 -> finally
23:29:24.766 -> AT+USORD=0,512

23:29:24.766 -> +USORD: 0,""
23:29:24.766 -> 
23:29:24.766 -> OK
23:29:24.799 -> AT+USORD=0,512

23:29:24.799 -> +USORD: 0,""
23:29:24.799 -> 
23:29:24.799 -> OK
23:29:24.846 -> AT+USORD=0,512

23:29:24.846 -> +USORD: 0,""
23:29:24.846 -> 
23:29:24.846 -> OK
23:29:24.846 -> AT+USORD=0,512

23:29:24.846 -> +USORD: 0,""
23:29:24.846 -> 
23:29:24.846 -> OK
23:29:24.893 -> AT+USORD=0,512

23:29:24.893 -> +USORD: 0,""
23:29:24.893 -> 
23:29:24.893 -> OK
23:29:24.893 -> AT+USORD=0,512

23:29:24.893 -> +USORD: 0,""
23:29:24.893 -> 
23:29:24.893 -> OK
23:29:24.940 -> AT+USORD=0,512

23:29:24.940 -> +USORD: 0,""
23:29:24.940 -> 
23:29:24.940 -> OK
23:29:24.940 -> AT+USORD=0,512

23:29:24.940 -> +USORD: 0,""
23:29:24.987 -> 
23:29:24.987 -> OK
23:29:24.987 -> AT+USORD=0,512

23:29:24.987 -> +USORD: 0,""
23:29:24.987 -> 
23:29:24.987 -> OK
23:29:25.034 -> AT+USORD=0,512

23:29:25.034 -> +USORD: 0,""
23:29:25.034 -> 
23:29:25.034 -> OK
23:29:25.034 -> AT+USORD=0,512

23:29:25.034 -> +USORD: 0,""
23:29:25.034 -> 
23:29:25.034 -> OK
23:29:25.081 -> AT+USORD=0,512

23:29:25.081 -> +USORD: 0,""
23:29:25.081 -> 
23:29:25.081 -> OK
23:29:25.081 -> AT+USORD=0,512

23:29:25.081 -> +USORD: 0,""
23:29:25.081 -> 
23:29:25.081 -> OK
23:29:25.128 -> AT+USORD=0,512

23:29:25.128 -> +USORD: 0,""
23:29:25.128 -> 
23:29:25.128 -> OK
23:29:25.128 -> AT+USORD=0,512

23:29:25.175 -> +USORD: 0,""
23:29:25.175 -> 
23:29:25.175 -> OK
23:29:25.175 -> AT+USORD=0,512

23:29:25.175 -> +USORD: 0,""
23:29:25.175 -> 
23:29:25.175 -> OK
23:29:25.221 -> AT+USORD=0,512

23:29:25.221 -> +USORD: 0,""
23:29:25.221 -> 
23:29:25.221 -> OK
23:29:25.221 -> AT+USORD=0,512

23:29:25.221 -> +USORD: 0,""
23:29:25.221 -> 
23:29:25.221 -> OK
23:29:25.268 -> AT+USORD=0,512

23:29:25.268 -> +USORD: 0,""
23:29:25.268 -> 
23:29:25.268 -> OK
23:29:25.268 -> AT+USORD=0,512

23:29:25.268 -> +USORD: 0,""
23:29:25.268 -> 
23:29:25.268 -> OK
23:29:25.315 -> AT+USORD=0,512

23:29:25.315 -> +USORD: 0,""
23:29:25.315 -> 
23:29:25.315 -> OK
23:29:25.362 -> AT+USORD=0,512

23:29:25.362 -> +USORD: 0,""
23:29:25.362 -> 
23:29:25.362 -> OK
23:29:25.362 -> AT+USORD=0,512

23:29:25.362 -> +USORD: 0,""
23:29:25.362 -> 
23:29:25.362 -> OK
23:29:25.409 -> AT+USORD=0,512

23:29:25.409 -> +USORD: 0,""
23:29:25.409 -> 
23:29:25.409 -> OK
23:29:25.409 -> AT+USORD=0,512

23:29:25.409 -> +USORD: 0,""
23:29:25.409 -> 
23:29:25.409 -> OK
23:29:25.456 -> AT+USORD=0,512

23:29:25.456 -> +USORD: 0,""
23:29:25.456 -> 
23:29:25.456 -> OK
23:29:25.456 -> AT+USORD=0,512

23:29:25.456 -> +USORD: 0,""
23:29:25.456 -> 
23:29:25.456 -> OK
23:29:25.503 -> AT+USORD=0,512

23:29:25.503 -> +USORD: 0,""
23:29:25.503 -> 
23:29:25.503 -> OK
23:29:25.550 -> AT+USORD=0,512

23:29:25.550 -> +USORD: 0,""
23:29:25.550 -> 
23:29:25.550 -> OK
23:29:25.550 -> AT+USORD=0,512

23:29:25.550 -> +USORD: 0,""
23:29:25.550 -> 
23:29:25.550 -> OK
23:29:25.597 -> 
23:29:25.597 -> +UUSORD: 0,48
23:29:25.597 -> AT+USORD=0,512

23:29:25.597 -> 
23:29:25.597 -> +USORD: 0,48,"485454502F312E3120343034204E6F7420466F756E640D0A5365727665723A206E67696E782F312E31302E330D0A436F"
23:29:25.597 -> OK
23:29:25.597 -> HTTP/1.1 404 Not Found
23:29:25.597 -> Server: nginx/1.10.3
23:29:25.597 -> CoAT+USORD=0,512

23:29:25.643 -> +USORD: 0,""
23:29:25.643 -> 
23:29:25.643 -> OK
23:29:25.643 -> 
23:29:25.643 -> +UUSORD: 0,48
23:29:25.643 -> AT+USORD=0,512

23:29:25.643 -> 
23:29:25.643 -> +USORD: 0,48,"6E74656E742D547970653A20746578742F68746D6C3B20636861727365743D5554462D380D0A5472616E736665722D45"
23:29:25.643 -> OK
23:29:25.643 -> ntent-Type: text/html; charset=UTF-8
23:29:25.643 -> Transfer-EAT+USORD=0,512

23:29:25.690 -> +USORD: 0,""
23:29:25.690 -> 
23:29:25.690 -> OK
23:29:25.690 -> AT+USORD=0,512

23:29:25.690 -> +USORD: 0,""
23:29:25.690 -> 
23:29:25.690 -> OK
23:29:25.737 -> 
23:29:25.737 -> +UUSORD: 0,48
23:29:25.737 -> AT+USORD=0,512

23:29:25.737 -> 
23:29:25.737 -> +USORD: 0,48,"6E636F64696E673A206368756E6B65640D0A436F6E6E656374696F6E3A20636C6F73650D0A566172793A204163636570"
23:29:25.737 -> OK
23:29:25.737 -> ncoding: chunked
23:29:25.737 -> Connection: close
23:29:25.737 -> Vary: Accep
23:29:25.784 -> +UUSORD: 0,48
23:29:25.784 -> AT+USORD=0,512

23:29:25.784 -> 
23:29:25.784 -> +USORD: 0,48,"742D456E636F64696E670D0A43616368652D436F6E74726F6C3A206E6F2D63616368652C20707269766174650D0A6461"
23:29:25.784 -> OK
23:29:25.784 -> t-Encoding
23:29:25.784 -> Cache-Control: no-cache, private
23:29:25.784 -> daAT+USORD=0,512

23:29:25.825 -> +USORD: 0,""
23:29:25.825 -> 
23:29:25.825 -> OK
23:29:25.825 -> AT+USORD=0,512

23:29:25.825 -> +USORD: 0,""
23:29:25.825 -> 
23:29:25.825 -> OK
23:29:25.871 -> 
23:29:25.871 -> +UUSORD: 0,48
23:29:25.871 -> AT+USORD=0,512

23:29:25.871 -> 
23:29:25.871 -> +USORD: 0,48,"74653A204D6F6E2C203036204D617920323031392032313A32393A323820474D540D0A582D526174654C696D69742D4C"
23:29:25.871 -> OK
23:29:25.871 -> te: Mon, 06 May 2019 21:29:28 GMT
23:29:25.871 -> X-RateLimit-LAT+USORD=0,512

23:29:25.919 -> +USORD: 0,""
23:29:25.919 -> 
23:29:25.919 -> OK
23:29:25.919 -> AT+USORD=0,512

23:29:25.919 -> +USORD: 0,""
23:29:25.919 -> 
23:29:25.919 -> OK
23:29:25.965 -> AT+USORD=0,512

23:29:25.965 -> +USORD: 0,""
23:29:25.965 -> 
23:29:25.965 -> OK
23:29:25.965 -> AT+USORD=0,512

23:29:25.965 -> +USORD: 0,""
23:29:25.965 -> 
23:29:25.965 -> OK
23:29:26.012 -> AT+USORD=0,512

23:29:26.012 -> +USORD: 0,""
23:29:26.012 -> 
23:29:26.012 -> OK
23:29:26.012 -> 
23:29:26.012 -> +UUSORD: 0,48
23:29:26.046 -> AT+USORD=0,512

23:29:26.046 -> 
23:29:26.046 -> +USORD: 0,48,"696D69743A2033300D0A582D526174654C696D69742D52656D61696E696E673A2032390D0A0D0A3238350D0A3C21444F"
23:29:26.046 -> OK
23:29:26.046 -> imit: 30
23:29:26.046 -> X-RateLimit-Remaining: 29
23:29:26.046 -> 
23:29:26.046 -> 285
23:29:26.046 -> <!DO
23:29:26.093 -> +UUSORD: 0,48
23:29:26.093 -> AT+USORD=0,512

23:29:26.093 -> 
23:29:26.093 -> +USORD: 0,48,"43545950452068746D6C3E0A3C68746D6C3E0A202020203C686561643E0A20202020202020203C6D6574612063686172"
23:29:26.093 -> OK
23:29:26.093 -> CTYPE html>
23:29:26.093 -> <html>
23:29:26.093 ->     <head>
23:29:26.093 ->         <meta charAT+USORD=0,512

23:29:26.093 -> +USORD: 0,""
23:29:26.093 -> 
23:29:26.093 -> OK
23:29:26.139 -> 
23:29:26.139 -> +UUSORD: 0,48
23:29:26.139 -> AT+USORD=0,512

23:29:26.139 -> 
23:29:26.139 -> +USORD: 0,48,"7365743D225554462D3822202F3E0A20202020202020203C6D657461206E616D653D22726F626F74732220636F6E7465"
23:29:26.139 -> OK
23:29:26.139 -> set="UTF-8" />
23:29:26.139 ->         <meta name="robots" conteAT+USORD=0,512

23:29:26.186 -> +USORD: 0,""
23:29:26.186 -> 
23:29:26.186 -> OK
23:29:26.186 -> 
23:29:26.186 -> +UUSORD: 0,48
23:29:26.186 -> AT+USORD=0,512

23:29:26.186 -> 
23:29:26.186 -> +USORD: 0,48,"6E743D226E6F696E6465782C6E6F666F6C6C6F7722202F3E0A20202020202020203C7374796C653E2020202020202020"
23:29:26.233 -> OK
23:29:26.233 -> nt="noindex,nofollow" />
23:29:26.233 ->         <style>        
23:29:26.233 -> +UUSORD: 0,48
23:29:26.233 -> AT+USORD=0,512

23:29:26.233 -> 
23:29:26.233 -> +USORD: 0,48,"2020202020202020626F6479207B206261636B67726F756E642D636F6C6F723A20236666663B20636F6C6F723A202332"
23:29:26.233 -> OK
23:29:26.233 ->         body { background-color: #fff; color: #2AT+USORD=0,512

23:29:26.280 -> +USORD: 0,""
23:29:26.280 -> 
23:29:26.280 -> OK
23:29:26.280 -> AT+USORD=0,512

23:29:26.280 -> +USORD: 0,""
.... and so on
23:29:37.513 -> OK
23:29:37.560 -> 
23:29:37.560 -> +UUSOCL: 0
23:29:37.560 -> AT+USORD=0,512

23:29:37.560 -> +CME ERROR: Operation not allowed
23:29:37.560 -> 
23:29:37.607 -> AT+USOCL=0

23:29:37.607 -> +CME ERROR: Operation not allowed
23:29:37.607 -> 
23:29:37.607 -> disconnecting.

@sandeepmistry
Copy link
Contributor

This log looks perfectly ok, to me:

23:29:23.819 -> AT+USOCO=0,"webhook.site",80

23:29:24.438 -> OK
23:29:24.438 -> connected

^ indicates a successful connection

23:29:25.597 -> +USORD: 0,48,"485454502F312E3120343034204E6F7420466F756E640D0A5365727665723A206E67696E782F312E31302E330D0A436F"
23:29:25.597 -> OK
23:29:25.597 -> HTTP/1.1 404 Not Found
23:29:25.597 -> Server: nginx/1.10.3
23:29:25.597 -> CoAT+USORD=0,512

....

^ indicates a HTTP response from the server.

@eikaramba
Copy link
Author

@sandeepmistry please have a look again. i posted 2 logs, one with ssl and one without. the one that worked was without ssl.
in the one with ssl you see:

23:26:48.525 -> +CME ERROR: Operation not allowed
23:26:48.559 -> 
23:26:48.559 -> AT+USOCL=0
test
23:27:01.493 -> 
23:27:01.493 -> OK

at the end

@sandeepmistry
Copy link
Contributor

Hi @eikaramba,

Sorry, I missed it ...

A few questions for you:

  1. Just to confirm you are using the NBSSLWebClient.ino example with the server changed to "webhook.site" ?

  2. Does the example work as is (with the arduino.cc domain)?

@eikaramba
Copy link
Author

Yes exactly. It's the exact same code apart from the different domain.
Using arduino.cc domain i have the same problem. it works withhout ssl, but not with ssl.

@sandeepmistry
Copy link
Contributor

Hmm, so it might be either of:

  1. the carrier is disabled SSL.
  2. the u-blox module can't sync the current time with the cellular network.

Some suggestions:
a) try another SIM if possible
b) add a Serial.println(nbAccess.getTime()); after the failed connection. To print the current time of the module.

@eikaramba
Copy link
Author

i finally had more time to debug this, but unfortunately it is still not working.

  1. i tried to print the local time and got the following:
OK
Starting modem test...AT
OK
modem.begin() succeeded
Local Time-----------
AT+CCLK?
+CCLK: "80/01/06,00:00:16"

OK
315964816
Time-----------
AT+CCLK?
+CCLK: "80/01/06,00:00:16"

this gives me the time since the device powered on(here 16 seconds). Is that right? I don't think so. but how can i "reset" or "set" the time?

the example with the ntp udp packet to get the time resulted in that:

Starting connection to server...
packet received
Seconds since Jan 1 1900 = 3786109524
Unix time = 1577120724
The UTC time is 17:05:24
packet received
Seconds since Jan 1 1900 = 3786109535
Unix time = 1577120735
The UTC time is 17:05:35
  1. i activated the debug via NB nbAccess(true); and once more tried to call webhook.site on port 443 via the nbsslclient example:
Starting Arduino web client.
AT

OK
AT

OK
AT+CMEE=0

OK
AT+CFUN=0

OK
AT+CPIN?

+CPIN: READY

OK
AT+CMGF=1

OK
AT+UDCONF=1,1

OK
AT+CTZU=1

OK
AT+CGDCONT=1,"IP",""

OK
AT+UAUTHREQ=1,0

OK
AT+CFUN=1

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,5

OK
AT+CGATT=1

OK
AT+CGACT?

+CGACT: 1,1

OK
connecting...
AT+USECMNG=0,0,"AddTrust_External_CA_Root",1082

>
+USECMNG: 0,0,"AddTrust_External_CA_Root","1D3554048578B03F42424DBF20730A3F"

OK
AT+USECMNG=0,0,"Baltimore_CyberTrust_Root",891

>
+USECMNG: 0,0,"Baltimore_CyberTrust_Root","ACB694A59C17E0D791529BB19706A6E4"

OK
AT+USECMNG=0,0,"COMODO_RSA_Certification_Authority",1500

>
+USECMNG: 0,0,"COMODO_RSA_Certification_Authority","1B31B0714036CC143691ADC43EFDEC18"

OK
AT+USECMNG=0,0,"DST_Root_CA_X3",846

>
+USECMNG: 0,0,"DST_Root_CA_X3","410352DC0FF7501B16F0028EBA6F45C5"

OK
AT+USECMNG=0,0,"DigiCert_High_Assurance_EV_Root_CA",969

>
+USECMNG: 0,0,"DigiCert_High_Assurance_EV_Root_CA","D474DE575C39B2D39C8583C5C065498A"

OK
AT+USECMNG=0,0,"Entrust_Root_Certification_Authority",1173

>
+USECMNG: 0,0,"Entrust_Root_Certification_Authority","D6A5C3ED5DDD3E00C13D87921F1D3FE4"

OK
AT+USECMNG=0,0,"Equifax_Secure_Certificate_Authority",804

>
+USECMNG: 0,0,"Equifax_Secure_Certificate_Authority","67CB9DC013248A829BB2171ED11BECD4"

OK
AT+USECMNG=0,0,"GeoTrust_Global_CA",856

>
+USECMNG: 0,0,"GeoTrust_Global_CA","F775AB29FB514EB7775EFF053C998EF5"

OK
AT+USECMNG=0,0,"GeoTrust_Primary_Certification_Authority_G3",1026

>
+USECMNG: 0,0,"GeoTrust_Primary_Certification_Authority_G3","B5E83436C910445848706D2E83D4B805"

OK
AT+USECMNG=0,0,"GlobalSign",958

>
+USECMNG: 0,0,"GlobalSign","9414777E3E5EFD8F30BD41B0CFE7D030"

OK
AT+USECMNG=0,0,"Go_Daddy_Root_Certificate_Authority_G2",969

>
+USECMNG: 0,0,"Go_Daddy_Root_Certificate_Authority_G2","803ABC22C1E6FB8D9B3B274A321B9A01"

OK
AT+USECMNG=0,0,"VeriSign_Class_3_Public_Primary_Certification_Authority_G5",1239

>
+USECMNG: 0,0,"VeriSign_Class_3_Public_Primary_Certification_Authority_G5","CB17E431673EE209FE455793F30AFA1C"

OK
AT+USECMNG=2,0,"AmazonRootCA1"

ERROR
AT+USECMNG=0,0,"Starfield_Services_Root_Certificate_Authority_G2",1011

>
+USECMNG: 0,0,"Starfield_Services_Root_Certificate_Authority_G2","173574AF7B611CEBF4F93CE2EE40F9A2"

OK
AT+USOCR=6

+USOCR: 0

OK
AT+USOSEC=0,1,0

OK
AT+USECPRF=0,0,1

OK
AT+USOCO=0,"webhook.site",443

OK
connected
AT+USOWR=0,4,"47455420"

ERROR
AT+USOWR=0,37,"2F65663435656532642D613331322D343632352D623539382D306262343233303161373161"

ERROR
AT+USOWR=0,9,"20485454502F312E31"

ERROR
AT+USOWR=0,2,"0D0A"

ERROR
AT+USOWR=0,6,"486F73743A20"

ERROR
AT+USOWR=0,12,"776562686F6F6B2E73697465"

ERROR
AT+USOWR=0,2,"0D0A"

ERROR
AT+USOWR=0,17,"436F6E6E656374696F6E3A20636C6F7365"

ERROR
AT+USOWR=0,2,"0D0A"

ERROR
AT+USOWR=0,2,"0D0A"

ERROR
AT+USORD=0,512

+USORD: 0,""

OK
AT+USORD=0,512

+USORD: 0,""

OK
AT+USORD=0,512

+USORD: 0,""

........
.......
......
hundred more of those USORD entries
......

+UUSOCL: 0
AT+USORD=0,512

ERROR
AT+USOCL=0

ERROR

disconnecting.

@eikaramba
Copy link
Author

i tried to manually send the http call via the http ubox module https://www.u-blox.com/sites/default/files/SARA-R4_ATCommands_%28UBX-17003787%29.pdf#%5B%7B%22num%22%3A694%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C59.527%2C742.677%2Cnull%5D

AT+UHTTP=0,1,"webhook.site"
AT+UHTTP=0,5,443
AT+UHTTP=0,6,1,0
AT+UHTTP=0,4,0
AT+UHTTPC=0,1,"/ef45ee2d-a312-4625-b598-0bb42301a71a","res"
OK

However this gives the following http error state

+UUHTTPCR: 0,1,0

AT+UHTTPER=0
+UHTTPER: 0,3,13

Looking at the manual this indicated an "internal error" in the HTTP Protocol
https://www.u-blox.com/sites/default/files/SARA-R4_ATCommands_%28UBX-17003787%29.pdf#%5B%7B%22num%22%3A865%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C59.527%2C584.377%2Cnull%5D

@crcer
Copy link

crcer commented Oct 14, 2020

Do you have any solution for this yet?
I am struggling with the same issue using a SimCard from 1nce.

@eikaramba
Copy link
Author

unfortunately i have given up. i really tried everything even tried to call all the AT commands manually myself etc. but i never got SSL working. at the end i create a http proxy on my server which basically handles the ssl handshake.

@dkoffler
Copy link

First of all, it looks like you are not getting the proper time from the cell network! It's outputting a date in 1980. This is probably messing a whole bunch of things up.

There are 2 things I would try...

  1. Upgrade the Ublox modem firmware. Once I did that, a whole bunch of problems I was having went away. This is a good video on how to do that: https://www.youtube.com/watch?v=33LCz9fjyes Just note that there are 2 different downloads for the firmware update files depending on which version of firmware you currently have A0200 or A0201. You can see which version you have after you install the Ublox tool described in the video.

  2. If that doesn't help, then try a different SIM from a different provider as previously suggested. the fact that you are not getting the correct time indicates the modem is having trouble communicating with the network. Are you sure you have CAT M1 or NB-IoT support in your area?

@netskink
Copy link

netskink commented Sep 4, 2021

Any method for adding a new root cert? I tried getting the cert with openssl s_client connect command. I took text between begin/end signature, decoded base64 and then put resulting hex and length in the header file. Sadly when it comes time to load the cert it fails.

@Hugocourr
Copy link

Any method for adding a new root cert? I tried getting the cert with openssl s_client connect command. I took text between begin/end signature, decoded base64 and then put resulting hex and length in the header file. Sadly when it comes time to load the cert it fails.

For updating new SSl certificate i made a tutorial on the MKRGSM that is easely portable onto the MKRNB (you just need to change the type of client to the one you usually use, here is the topic (see 2nd comment for the tutorial) arduino-libraries/MKRGSM#151
Hope it will help you!

@WLewington
Copy link

WLewington commented Jan 4, 2023

I'm starting to really hate Arduino MKR series ... very little support, almost all the library's have flaws and bugs. It's been incredibly painful just to get this board to behave itself.
I've got the same issue, still searching for a solution.
Also had problems with the modem class crashing when its woken from sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants