[gnutls-devel] GnuTLS | Unexpected TLS packet during handshake with Twitter.com (#841)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Mon Sep 30 22:11:14 CEST 2019




IBBoard commented:


Okay, I've got a "minimal" Vala and [librest](https://github.com/GNOME/librest) case (plus the necessary vapi files) that will intermittently error. No Twitter credentials required (because it's an SSL error and so we don't have to have a valid user)

```
async void ssl_test () {
    for (int i = 0; i < 60; i++) {
        var proxy = new Rest.OAuthProxy ("a",
                                         "b",
                                         "https://api.twitter.com/",
                                         false);
        var call = proxy.new_call ();
        call.set_method ("GET");
        call.set_function ("1.1/statuses/home_timeline.json");
        call.add_param ("since_id", "1173176929995907072");
        call.add_param ("count", "200");
        call.add_param ("contributor_details", "true");
        call.add_param ("tweet_mode", "extended");
        call.add_param ("include_my_retweet", "true");
        call.invoke_async.begin (null, (obj, res) => {
            try {
                call.invoke_async.end (res);
            } catch (GLib.Error e) {
            if (e.code < 400)
                warning(e.message);
            }
            ssl_test.callback();
        });
        yield;
        GLib.Thread.usleep(1000000 * 2);
    }
}


int main (string[] args) {
    var loop = new MainLoop();
    ssl_test.begin ((obj, res) => {
        loop.quit();
    });
    loop.run();
    return 0;
}
```

I saw about 15 out of the 60 requests return `Error performing TLS handshake: An unexpected TLS packet was received` when I just ran it.

I'll try to strip it down from there on another night. I had to put the proxy creation in the loop so that it didn't keep re-using the connection. I suspect other background tasks are consuming the connection pool in the app, which is why I saw different behaviour when reusing the proxy (as the app does).

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/841#note_224130264
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190930/2a9dd6c1/attachment.html>


More information about the Gnutls-devel mailing list