Changeset 122547 in webkit


Ignore:
Timestamp:
Jul 13, 2012 12:26:17 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Add API to get HTTPS status to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=91100

Reviewed by Martin Robinson.

Source/WebCore:

  • platform/network/soup/ResourceResponse.h:

(WebCore::ResourceResponse::soupMessageCertificate): Return the
certificate.
(WebCore::ResourceResponse::setSoupMessageCertificate): Set a
certificate.
(WebCore::ResourceResponse::soupMessageTLSErrors): Return the TLS
errors.
(WebCore::ResourceResponse::setSoupMessageTLSErrors): Set TLS
errors.

  • platform/network/soup/ResourceResponseSoup.cpp:

(WebCore::ResourceResponse::toSoupMessage): Set the certificate
and TLS errors to the newly created SoupMessage.
(WebCore::ResourceResponse::updateFromSoupMessage): Get the
certificate and TLS errors from the SoupMessage.

Source/WebKit2:

Add webkit_uri_response_get_https_status() to return
GTlsCertificate and GTlsCertificateFlags with information about
the SSL certificate and the possible errors with the certificate.

  • GNUmakefile.list.am: Add new files to compilation.
  • PlatformEfl.cmake: Ditto.
  • Shared/efl/PlatformCertificateInfo.h: Removed.
  • Shared/soup/PlatformCertificateInfo.cpp: Added.

(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::~PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode): Encode the
GTlsCertificate and GTlsCertificateFlags.
(WebKit::PlatformCertificateInfo::decode): Decode
PlatformCertificateInfo into a GTlsCertificate and GTlsCertificateFlags.

  • Shared/soup/PlatformCertificateInfo.h: Renamed from Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h.

(WebKit::PlatformCertificateInfo::certificate): Return the certificate.
(WebKit::PlatformCertificateInfo::tlsErrors): Return the TLS errors

  • UIProcess/API/gtk/WebKitLoaderClient.cpp:

(didCommitLoadForFrame): Set the certificate of the current frame
to the response of the main resource.

  • UIProcess/API/gtk/WebKitURIResponse.cpp:

(webkit_uri_response_get_https_status): Return GTlsCertificate and
GTlsCertificateFlags.
(webkitURIResponseSetCertificateInfo): Update the internal
ResourceResponse with the GTlsCertificate and GTlsCertificateFlags
of the given PlatformCertificateInfo.

  • UIProcess/API/gtk/WebKitURIResponse.h:
  • UIProcess/API/gtk/WebKitURIResponsePrivate.h:
  • UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
  • UIProcess/API/gtk/tests/GNUmakefile.am:
  • UIProcess/API/gtk/tests/TestMain.h:

(Test::getResourcesDir): Helper function to get the resources
directory of the WebKit2 API tests.

  • UIProcess/API/gtk/tests/TestSSL.cpp: Added.

(testSSL):
(serverCallback):
(beforeAll):
(afterAll):

  • UIProcess/API/gtk/tests/WebKitTestServer.cpp:

(WebKitTestServer::WebKitTestServer): Add support por SSL test
servers.

  • UIProcess/API/gtk/tests/WebKitTestServer.h:

(WebKitTestServer): Add ssl parameter to create a HTTPS server.

  • UIProcess/API/gtk/tests/resources/test-cert.pem: Added.
  • UIProcess/API/gtk/tests/resources/test-key.pem: Added.

Source/WTF:

Add support for GByteArray.

  • wtf/gobject/GRefPtr.cpp:

(WTF::refGPtr):
(WTF):
(WTF::derefGPtr):

  • wtf/gobject/GRefPtr.h:

(WTF):

  • wtf/gobject/GTypedefs.h:
Location:
trunk/Source
Files:
5 added
1 deleted
19 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r122491 r122547  
     12012-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add API to get HTTPS status to WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=91100
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add support for GByteArray.
     9
     10        * wtf/gobject/GRefPtr.cpp:
     11        (WTF::refGPtr):
     12        (WTF):
     13        (WTF::derefGPtr):
     14        * wtf/gobject/GRefPtr.h:
     15        (WTF):
     16        * wtf/gobject/GTypedefs.h:
     17
    1182012-07-12  Maciej Stachowiak  <mjs@apple.com>
    219
  • trunk/Source/WTF/wtf/gobject/GRefPtr.cpp

    r115411 r122547  
    121121}
    122122
     123template <> GByteArray* refGPtr(GByteArray* ptr)
     124{
     125    if (ptr)
     126        g_byte_array_ref(ptr);
     127    return ptr;
     128}
     129
     130template <> void derefGPtr(GByteArray* ptr)
     131{
     132    if (ptr)
     133        g_byte_array_unref(ptr);
     134}
     135
    123136} // namespace WTF
    124137
  • trunk/Source/WTF/wtf/gobject/GRefPtr.h

    r115411 r122547  
    211211template <> GPtrArray* refGPtr(GPtrArray*);
    212212template <> void derefGPtr(GPtrArray*);
     213template <> GByteArray* refGPtr(GByteArray*);
     214template <> void derefGPtr(GByteArray*);
    213215
    214216template <typename T> inline T* refGPtr(T* ptr)
  • trunk/Source/WTF/wtf/gobject/GTypedefs.h

    r115411 r122547  
    6565typedef struct _GKeyFile GKeyFile;
    6666typedef struct _GPtrArray GPtrArray;
     67typedef struct _GByteArray GByteArray;
    6768
    6869#if USE(CAIRO)
  • trunk/Source/WebCore/ChangeLog

    r122546 r122547  
     12012-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add API to get HTTPS status to WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=91100
     5
     6        Reviewed by Martin Robinson.
     7
     8        * platform/network/soup/ResourceResponse.h:
     9        (WebCore::ResourceResponse::soupMessageCertificate): Return the
     10        certificate.
     11        (WebCore::ResourceResponse::setSoupMessageCertificate): Set a
     12        certificate.
     13        (WebCore::ResourceResponse::soupMessageTLSErrors): Return the TLS
     14        errors.
     15        (WebCore::ResourceResponse::setSoupMessageTLSErrors): Set TLS
     16        errors.
     17        * platform/network/soup/ResourceResponseSoup.cpp:
     18        (WebCore::ResourceResponse::toSoupMessage): Set the certificate
     19        and TLS errors to the newly created SoupMessage.
     20        (WebCore::ResourceResponse::updateFromSoupMessage): Get the
     21        certificate and TLS errors from the SoupMessage.
     22
    1232012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
    224
  • trunk/Source/WebCore/platform/network/soup/ResourceResponse.h

    r104948 r122547  
    3030
    3131#include <libsoup/soup.h>
     32#include <wtf/gobject/GRefPtr.h>
    3233
    3334namespace WebCore {
     
    3839        : ResourceResponseBase()
    3940        , m_soupFlags(static_cast<SoupMessageFlags>(0))
     41        , m_tlsErrors(static_cast<GTlsCertificateFlags>(0))
    4042    {
    4143    }
     
    4446        : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
    4547        , m_soupFlags(static_cast<SoupMessageFlags>(0))
     48        , m_tlsErrors(static_cast<GTlsCertificateFlags>(0))
    4649    {
    4750    }
     
    5053        : ResourceResponseBase()
    5154        , m_soupFlags(static_cast<SoupMessageFlags>(0))
     55        , m_tlsErrors(static_cast<GTlsCertificateFlags>(0))
    5256    {
    5357        updateFromSoupMessage(soupMessage);
     
    6367    void setSniffedContentType(const String& value) { m_sniffedContentType = value; }
    6468
     69    GTlsCertificate* soupMessageCertificate() const { return m_certificate.get(); }
     70    void setSoupMessageCertificate(GTlsCertificate* certificate) { m_certificate = certificate; }
     71
     72    GTlsCertificateFlags soupMessageTLSErrors() const { return m_tlsErrors; }
     73    void setSoupMessageTLSErrors(GTlsCertificateFlags tlsErrors) { m_tlsErrors = tlsErrors; }
     74
    6575private:
    6676    friend class ResourceResponseBase;
     
    6878    SoupMessageFlags m_soupFlags;
    6979    String m_sniffedContentType;
     80    GRefPtr<GTlsCertificate> m_certificate;
     81    GTlsCertificateFlags m_tlsErrors;
    7082
    7183    void doUpdateResourceResponse() { }
  • trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp

    r111354 r122547  
    5252    soup_message_set_flags(soupMessage, m_soupFlags);
    5353
     54    g_object_set(G_OBJECT(soupMessage), "tls-certificate", m_certificate.get(), "tls-errors", m_tlsErrors, NULL);
     55
    5456    // Body data is not in the message.
    5557    return soupMessage;
     
    8587    setHTTPStatusText(soupMessage->reason_phrase);
    8688    setSuggestedFilename(filenameFromHTTPContentDisposition(httpHeaderField("Content-Disposition")));
     89
     90    GTlsCertificate* certificate = 0;
     91    soup_message_get_https_status(soupMessage, &certificate, &m_tlsErrors);
     92    m_certificate = certificate;
    8793}
    8894
  • trunk/Source/WebKit2/ChangeLog

    r122542 r122547  
     12012-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add API to get HTTPS status to WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=91100
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add webkit_uri_response_get_https_status() to return
     9        GTlsCertificate and GTlsCertificateFlags with information about
     10        the SSL certificate and the possible errors with the certificate.
     11
     12        * GNUmakefile.list.am: Add new files to compilation.
     13        * PlatformEfl.cmake: Ditto.
     14        * Shared/efl/PlatformCertificateInfo.h: Removed.
     15        * Shared/soup/PlatformCertificateInfo.cpp: Added.
     16        (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
     17        (WebKit::PlatformCertificateInfo::~PlatformCertificateInfo):
     18        (WebKit::PlatformCertificateInfo::encode): Encode the
     19        GTlsCertificate and GTlsCertificateFlags.
     20        (WebKit::PlatformCertificateInfo::decode): Decode
     21        PlatformCertificateInfo into a GTlsCertificate and GTlsCertificateFlags.
     22        * Shared/soup/PlatformCertificateInfo.h: Renamed from Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h.
     23        (WebKit::PlatformCertificateInfo::certificate): Return the certificate.
     24        (WebKit::PlatformCertificateInfo::tlsErrors): Return the TLS errors
     25        * UIProcess/API/gtk/WebKitLoaderClient.cpp:
     26        (didCommitLoadForFrame): Set the certificate of the current frame
     27        to the response of the main resource.
     28        * UIProcess/API/gtk/WebKitURIResponse.cpp:
     29        (webkit_uri_response_get_https_status): Return GTlsCertificate and
     30        GTlsCertificateFlags.
     31        (webkitURIResponseSetCertificateInfo): Update the internal
     32        ResourceResponse with the GTlsCertificate and GTlsCertificateFlags
     33        of the given PlatformCertificateInfo.
     34        * UIProcess/API/gtk/WebKitURIResponse.h:
     35        * UIProcess/API/gtk/WebKitURIResponsePrivate.h:
     36        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
     37        * UIProcess/API/gtk/tests/GNUmakefile.am:
     38        * UIProcess/API/gtk/tests/TestMain.h:
     39        (Test::getResourcesDir): Helper function to get the resources
     40        directory of the WebKit2 API tests.
     41        * UIProcess/API/gtk/tests/TestSSL.cpp: Added.
     42        (testSSL):
     43        (serverCallback):
     44        (beforeAll):
     45        (afterAll):
     46        * UIProcess/API/gtk/tests/WebKitTestServer.cpp:
     47        (WebKitTestServer::WebKitTestServer): Add support por SSL test
     48        servers.
     49        * UIProcess/API/gtk/tests/WebKitTestServer.h:
     50        (WebKitTestServer): Add ssl parameter to create a HTTPS server.
     51        * UIProcess/API/gtk/tests/resources/test-cert.pem: Added.
     52        * UIProcess/API/gtk/tests/resources/test-key.pem: Added.
     53
    1542012-07-12  Christophe Dumez  <christophe.dumez@intel.com>
    255
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r122425 r122547  
    371371        Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
    372372        Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
    373         Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h \
    374373        Source/WebKit2/Shared/gtk/PrintInfoGtk.cpp \
    375374        Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
     
    428427        Source/WebKit2/Shared/StatisticsData.h \
    429428        Source/WebKit2/Shared/StringPairVector.h \
     429        Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp \
     430        Source/WebKit2/Shared/soup/PlatformCertificateInfo.h \
    430431        Source/WebKit2/Shared/soup/SoupCookiePersistentStorageType.h \
    431432        Source/WebKit2/Shared/TextCheckerState.h \
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r122512 r122547  
    2727    Shared/efl/WebEventFactory.cpp
    2828    Shared/efl/WebCoreArgumentCodersEfl.cpp
     29
     30    Shared/soup/PlatformCertificateInfo.cpp
    2931
    3032    UIProcess/API/C/efl/WKView.cpp
  • trunk/Source/WebKit2/Shared/soup/PlatformCertificateInfo.h

    r122546 r122547  
    2828#define PlatformCertificateInfo_h
    2929
    30 #include "ArgumentDecoder.h"
    31 #include "ArgumentEncoder.h"
    32 #include <WebCore/ResourceResponse.h>
     30#include <libsoup/soup.h>
     31#include <wtf/gobject/GRefPtr.h>
     32
     33namespace CoreIPC {
     34class ArgumentDecoder;
     35class ArgumentEncoder;
     36}
     37
     38namespace WebCore {
     39class ResourceResponse;
     40}
    3341
    3442namespace WebKit {
     
    3644class PlatformCertificateInfo {
    3745public:
    38     PlatformCertificateInfo()
    39     {
    40     }
     46    PlatformCertificateInfo();
     47    explicit PlatformCertificateInfo(const WebCore::ResourceResponse&);
     48    ~PlatformCertificateInfo();
    4149
    42     explicit PlatformCertificateInfo(const WebCore::ResourceResponse&)
    43     {
    44     }
     50    GTlsCertificate* certificate() const { return m_certificate.get(); }
     51    GTlsCertificateFlags tlsErrors() const { return m_tlsErrors; }
    4552
    46     void encode(CoreIPC::ArgumentEncoder*) const
    47     {
    48     }
     53    void encode(CoreIPC::ArgumentEncoder*) const;
     54    static bool decode(CoreIPC::ArgumentDecoder*, PlatformCertificateInfo&);
    4955
    50     static bool decode(CoreIPC::ArgumentDecoder*, PlatformCertificateInfo&)
    51     {
    52         return true;
    53     }
     56private:
     57    GRefPtr<GTlsCertificate> m_certificate;
     58    GTlsCertificateFlags m_tlsErrors;
    5459};
    5560
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp

    r120301 r122547  
    2323
    2424#include "WebKitBackForwardListPrivate.h"
     25#include "WebKitURIResponsePrivate.h"
    2526#include "WebKitWebViewBasePrivate.h"
    2627#include "WebKitWebViewPrivate.h"
     
    6566        return;
    6667
    67     webkitWebViewLoadChanged(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_LOAD_COMMITTED);
     68    WebKitWebView* webView = WEBKIT_WEB_VIEW(clientInfo);
     69    WebKitURIResponse* response = webkit_web_resource_get_response(webkit_web_view_get_main_resource(webView));
     70    webkitURIResponseSetCertificateInfo(response, WKFrameGetCertificateInfo(frame));
     71
     72    webkitWebViewLoadChanged(webView, WEBKIT_LOAD_COMMITTED);
    6873}
    6974
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp

    r118786 r122547  
    2121#include "WebKitURIResponse.h"
    2222
     23#include "PlatformCertificateInfo.h"
     24#include "WebCertificateInfo.h"
    2325#include "WebKitPrivate.h"
    2426#include "WebKitURIResponsePrivate.h"
     
    3537};
    3638
     39using namespace WebKit;
    3740using namespace WebCore;
    3841
     
    203206}
    204207
     208/**
     209 * webkit_uri_response_get_https_status:
     210 * @response: a #WebKitURIResponse
     211 * @certificate: (out) (transfer none): return location for a #GTlsCertificate
     212 * @errors: (out): return location for a #GTlsCertificateFlags the verification status of @certificate
     213 *
     214 * Retrieves the #GTlsCertificate associated with the @response connection,
     215 * and the #GTlsCertificateFlags showing what problems, if any, have been found
     216 * with that certificate.
     217 * If the response connection is not HTTPS, this function returns %FALSE.
     218 *
     219 * Returns: %TRUE if @response connection uses HTTPS or %FALSE otherwise.
     220 */
     221gboolean webkit_uri_response_get_https_status(WebKitURIResponse* response, GTlsCertificate** certificate, GTlsCertificateFlags* errors)
     222{
     223    g_return_val_if_fail(WEBKIT_IS_URI_RESPONSE(response), FALSE);
     224
     225    if (certificate)
     226        *certificate = response->priv->resourceResponse.soupMessageCertificate();
     227    if (errors)
     228        *errors = response->priv->resourceResponse.soupMessageTLSErrors();
     229
     230    return !!response->priv->resourceResponse.soupMessageCertificate();
     231}
     232
    205233WebKitURIResponse* webkitURIResponseCreateForResourceResponse(const WebCore::ResourceResponse& resourceResponse)
    206234{
     
    214242    return uriResponse->priv->resourceResponse;
    215243}
     244
     245void webkitURIResponseSetCertificateInfo(WebKitURIResponse* response, WKCertificateInfoRef wkCertificate)
     246{
     247    const PlatformCertificateInfo& certificateInfo = toImpl(wkCertificate)->platformCertificateInfo();
     248    response->priv->resourceResponse.setSoupMessageCertificate(certificateInfo.certificate());
     249    response->priv->resourceResponse.setSoupMessageTLSErrors(certificateInfo.tlsErrors());
     250}
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h

    r118786 r122547  
    2525#define WebKitURIResponse_h
    2626
    27 #include <glib-object.h>
     27#include <gio/gio.h>
    2828#include <webkit2/WebKitDefines.h>
    2929
     
    5757
    5858WEBKIT_API const gchar *
    59 webkit_uri_response_get_uri            (WebKitURIResponse *response);
     59webkit_uri_response_get_uri            (WebKitURIResponse    *response);
    6060
    6161WEBKIT_API guint
    62 webkit_uri_response_get_status_code    (WebKitURIResponse *response);
     62webkit_uri_response_get_status_code    (WebKitURIResponse    *response);
    6363
    6464WEBKIT_API guint64
    65 webkit_uri_response_get_content_length (WebKitURIResponse *response);
     65webkit_uri_response_get_content_length (WebKitURIResponse    *response);
    6666
    6767WEBKIT_API const gchar *
    68 webkit_uri_response_get_mime_type      (WebKitURIResponse *response);
     68webkit_uri_response_get_mime_type      (WebKitURIResponse    *response);
     69
     70WEBKIT_API gboolean
     71webkit_uri_response_get_https_status   (WebKitURIResponse    *response,
     72                                        GTlsCertificate     **certificate,
     73                                        GTlsCertificateFlags *errors);
    6974
    7075G_END_DECLS
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h

    r104850 r122547  
    3232WebKitURIResponse* webkitURIResponseCreateForResourceResponse(const WebCore::ResourceResponse&);
    3333const WebCore::ResourceResponse& webkitURIResponseGetResourceResponse(WebKitURIResponse*);
     34void webkitURIResponseSetCertificateInfo(WebKitURIResponse*, WKCertificateInfoRef);
    3435
    3536#endif // WebKitURIResponsePrivate_h
  • trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt

    r122425 r122547  
    316316webkit_uri_response_get_content_length
    317317webkit_uri_response_get_mime_type
     318webkit_uri_response_get_https_status
    318319
    319320<SUBSECTION Standard>
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am

    r121093 r122547  
    1010        Programs/WebKit2APITests/TestPrinting \
    1111        Programs/WebKit2APITests/TestResources \
     12        Programs/WebKit2APITests/TestSSL \
    1213        Programs/WebKit2APITests/TestWebKitVersion \
    1314        Programs/WebKit2APITests/TestWebKitFindController \
     
    175176Programs_WebKit2APITests_TestContextMenu_LDFLAGS = $(webkit2_tests_ldflags)
    176177
     178Programs_WebKit2APITests_TestSSL_SOURCES = \
     179        Source/WebKit2/UIProcess/API/gtk/tests/TestSSL.cpp
     180Programs_WebKit2APITests_TestSSL_CPPFLAGS = $(webkit2_tests_cppflags)
     181Programs_WebKit2APITests_TestSSL_LDADD = $(webkit2_tests_ldadd)
     182Programs_WebKit2APITests_TestSSL_LDFLAGS = $(webkit2_tests_ldflags)
     183
    177184endif # ENABLE_WEBKIT2
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h

    r121093 r122547  
    7676    }
    7777
     78    static CString getResourcesDir()
     79    {
     80        GOwnPtr<char> resourcesDir(g_build_filename(WEBKIT_SRC_DIR, "Source", "WebKit2", "UIProcess", "API", "gtk", "tests", "resources", NULL));
     81        return resourcesDir.get();
     82    }
     83
    7884    void addLogFatalFlag(unsigned flag)
    7985    {
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.cpp

    r97366 r122547  
    2121#include "WebKitTestServer.h"
    2222
     23#include "TestMain.h"
    2324#include <wtf/gobject/GOwnPtr.h>
    2425
    25 WebKitTestServer::WebKitTestServer()
    26     : m_soupServer(adoptGRef(soup_server_new(SOUP_SERVER_PORT, 0, NULL)))
    27     , m_baseURI(soup_uri_new("http://127.0.0.1/"))
     26WebKitTestServer::WebKitTestServer(ServerType type)
    2827{
     28    GOwnPtr<char> sslCertificateFile;
     29    GOwnPtr<char> sslKeyFile;
     30    if (type == ServerHTTPS) {
     31        CString resourcesDir = Test::getResourcesDir();
     32        sslCertificateFile.set(g_build_filename(resourcesDir.data(), "test-cert.pem", NULL));
     33        sslKeyFile.set(g_build_filename(resourcesDir.data(), "test-key.pem", NULL));
     34    }
     35
     36    GRefPtr<SoupAddress> address = adoptGRef(soup_address_new("127.0.0.1", SOUP_ADDRESS_ANY_PORT));
     37    soup_address_resolve_sync(address.get(), 0);
     38
     39    m_soupServer = adoptGRef(soup_server_new(SOUP_SERVER_INTERFACE, address.get(),
     40                                             SOUP_SERVER_SSL_CERT_FILE, sslCertificateFile.get(),
     41                                             SOUP_SERVER_SSL_KEY_FILE, sslKeyFile.get(), NULL));
     42    m_baseURI = type == ServerHTTPS ? soup_uri_new("https://127.0.0.1/") : soup_uri_new("http://127.0.0.1/");
    2943    soup_uri_set_port(m_baseURI, soup_server_get_port(m_soupServer.get()));
    3044}
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.h

    r97366 r122547  
    2828class WebKitTestServer {
    2929public:
    30     WebKitTestServer();
     30
     31    enum ServerType {
     32        ServerHTTP,
     33        ServerHTTPS
     34    };
     35
     36    WebKitTestServer(ServerType type = ServerHTTP);
    3137    virtual ~WebKitTestServer();
    3238
Note: See TracChangeset for help on using the changeset viewer.