GTlsCertificate issues - always BadRequest / 400



Is anything wrong with the below code? The very last asseration fails which is kinda weird, if I remove everything ssl related it works just fine. Also the auth callback is never called when using 

curl -vvv -k -i -X PUT -d "<foo />< bar />" "https://127.0.0.1:1234/?query=something"

(a selfsigned cert created according to http://www.devsec.org/info/ssl-cert.html thus the -k option is necessary)


  cache = cache_new ();
  server = soup_server_new (SOUP_SERVER_PORT, (guint)opts.server.port,
                         SOUP_SERVER_SERVER_HEADER, "eebusrestifier",
                         SOUP_SERVER_TLS_CERTIFICATE, tlscert,
                         NULL);
  authdomain = soup_auth_domain_digest_new (
                       SOUP_AUTH_DOMAIN_REALM, REALM, /*defined in accessstore.h*/
                    NULL);
  soup_auth_domain_digest_set_auth_callback (authdomain,
                                             auth_digest_callback,
                                             user_store/* user_data */,
                                             (GDestroyNotify)NULL);
  soup_server_add_auth_domain (server, SOUP_AUTH_DOMAIN (authdomain));
  soup_server_add_handler (server,
                        NULL /* path this callback will handle, NULL for all/being default handler */,
                        server_callback,
                        cache/* user_data */,
                        (GDestroyNotify)NULL /*free func for user data*/);
  soup_server_run_async (server);
  g_assert (soup_server_is_https (server)); // FAILS





curl output:

* About to connect() to 127.0.0.1 port 1234 (#0)
* Trying 127.0.0.1...
* Adding handle: conn: 0xf61670
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xf61670) send_pipe: 1, recv_pipe: 0
* Connected to 127.0.0.1 (127.0.0.1) port 1234 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: C=AU; ST=Some-State; O=Internet Widgits Pty Ltd
* start date: 2013-10-10 01:33:34 GMT
* expire date: 2023-10-08 01:33:34 GMT
* issuer: C=AU; ST=Some-State; O=Internet Widgits Pty Ltd
* SSL certificate verify result: self signed certificate (18), continuing anyway.
> PUT /?query=something HTTP/1.1
> User-Agent: curl/7.32.0
> Host: 127.0.0.1:1234
> Accept: */*
> Content-Length: 138
> Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 138 out of 138 bytes
< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
* Server eebusrestifier is not blacklisted
< Server: eebusrestifier
Server: eebusrestifier
< Content-Length: 0
Content-Length: 0

* Connection #0 to host 127.0.0.1 left intact

Thanks a lot in advance!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]