Changeset 102599 in webkit


Ignore:
Timestamp:
Dec 12, 2011 10:18:07 AM (12 years ago)
Author:
kubo@profusion.mobi
Message:

[EFL] Add API to manage root X.509 CA certificates.
https://bugs.webkit.org/show_bug.cgi?id=74300

Reviewed by Martin Robinson.

  • ewk/ewk_network.cpp:

(ewk_network_tls_ca_certificates_path_get):
(ewk_network_tls_ca_certificates_path_set):

  • ewk/ewk_network.h:
Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r102598 r102599  
     12011-12-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        [EFL] Add API to manage root X.509 CA certificates.
     4        https://bugs.webkit.org/show_bug.cgi?id=74300
     5
     6        Reviewed by Martin Robinson.
     7
     8        * ewk/ewk_network.cpp:
     9        (ewk_network_tls_ca_certificates_path_get):
     10        (ewk_network_tls_ca_certificates_path_set):
     11        * ewk/ewk_network.h:
     12
    1132011-12-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
    214
  • trunk/Source/WebKit/efl/ewk/ewk_network.cpp

    r102598 r102599  
    9696}
    9797
     98const char* ewk_network_tls_ca_certificates_path_get()
     99{
     100    const char* bundlePath = 0;
     101
     102#if USE(SOUP)
     103    SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
     104    g_object_get(defaultSession, "ssl-ca-file", &bundlePath, NULL);
     105#endif
     106
     107    return bundlePath;
     108}
     109
     110void ewk_network_tls_ca_certificates_path_set(const char* bundlePath)
     111{
     112#if USE(SOUP)
     113    SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
     114    g_object_set(defaultSession, "ssl-ca-file", bundlePath, NULL);
     115#endif
     116}
     117
    98118SoupSession* ewk_network_default_soup_session_get()
    99119{
  • trunk/Source/WebKit/efl/ewk/ewk_network.h

    r102598 r102599  
    6161 *
    6262 * By default, HTTPS connections are performed regardless of the validity of the certificate provided.
     63 *
     64 * @sa ewk_network_tls_ca_certificates_path_set
    6365 */
    6466EAPI Eina_Bool        ewk_network_tls_certificate_check_get(void);
     
    7072 *
    7173 * @param enable Whether to check the provided certificates or not.
     74 *
     75 * @sa ewk_network_tls_ca_certificates_path_set
    7276 */
    7377EAPI void             ewk_network_tls_certificate_check_set(Eina_Bool enable);
     78
     79/**
     80 * Returns the path to a file containing the platform's root X.509 CA certificates.
     81 *
     82 * The file is a list of concatenated PEM-format X.509 certificates used as root CA certificates.
     83 * They are used to validate all the certificates received when a TLS connection (such as an HTTPS one) is made.
     84 *
     85 * If @c ewk_network_tls_certificate_check_get() returns @c EINA_TRUE, the certificates set by this function
     86 * will be used to decide whether a certificate provided by a web site is invalid and the request should then
     87 * be cancelled.
     88 *
     89 * By default, the path is not set, so all certificates are considered as not signed by a trusted root CA.
     90 *
     91 * @sa ewk_network_tls_certificate_check_set
     92 */
     93EAPI const char      *ewk_network_tls_ca_certificates_path_get(void);
     94
     95/**
     96 * Sets the path to a file containing the platform's root X.509 CA certificates.
     97 *
     98 * The file is a list of concatenated PEM-format X.509 certificates used as root CA certificates.
     99 * They are used to validate all the certificates received when a TLS connection (such as an HTTPS one) is made.
     100 *
     101 * If @c ewk_network_tls_certificate_check_get() returns @c EINA_TRUE, the certificates set by this function
     102 * will be used to decide whether a certificate provided by a web site is invalid and the request should then
     103 * be cancelled.
     104 *
     105 * By default, the path is not set, so all certificates are considered as not signed by a trusted root CA.
     106 *
     107 * @param path The path to the certificate bundle.
     108 *
     109 * @sa ewk_network_tls_certificate_check_set
     110 */
     111EAPI void             ewk_network_tls_ca_certificates_path_set(const char *path);
    74112
    75113/**
Note: See TracChangeset for help on using the changeset viewer.