2
Copyright (C) 2011 Samsung Electronics
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
21
#include "ewk_network.h"
23
#include "NetworkStateNotifier.h"
24
#include "ProxyResolverSoup.h"
25
#include "ResourceHandle.h"
26
#include "ewk_private.h"
28
#include <libsoup/soup.h>
29
#include <wtf/text/CString.h>
31
void ewk_network_proxy_uri_set(const char* proxy)
33
SoupSession* session = WebCore::ResourceHandle::defaultSession();
36
ERR("no proxy uri. remove proxy feature in soup.");
37
soup_session_remove_feature_by_type(session, SOUP_TYPE_PROXY_RESOLVER);
41
SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(proxy, 0);
42
soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
43
g_object_unref(resolverEfl);
46
const char* ewk_network_proxy_uri_get(void)
49
SoupSession* session = WebCore::ResourceHandle::defaultSession();
50
SoupProxyURIResolver* resolver = SOUP_PROXY_URI_RESOLVER(soup_session_get_feature(session, SOUP_TYPE_PROXY_RESOLVER));
54
g_object_get(resolver, SOUP_PROXY_RESOLVER_WK_PROXY_URI, &uri, NULL);
61
WTF::String proxy = soup_uri_to_string(uri, false);
62
return eina_stringshare_add(proxy.utf8().data());
65
Eina_Bool ewk_network_tls_certificate_check_get()
67
bool checkCertificates = false;
69
SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
70
g_object_get(defaultSession, "ssl-strict", &checkCertificates, NULL);
72
return checkCertificates;
75
void ewk_network_tls_certificate_check_set(Eina_Bool checkCertificates)
77
SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
78
g_object_set(defaultSession, "ssl-strict", checkCertificates, NULL);
81
const char* ewk_network_tls_ca_certificates_path_get()
83
const char* bundlePath = 0;
85
SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
86
g_object_get(defaultSession, "ssl-ca-file", &bundlePath, NULL);
91
void ewk_network_tls_ca_certificates_path_set(const char* bundlePath)
93
SoupSession* defaultSession = WebCore::ResourceHandle::defaultSession();
94
g_object_set(defaultSession, "ssl-ca-file", bundlePath, NULL);
97
SoupSession* ewk_network_default_soup_session_get()
99
return WebCore::ResourceHandle::defaultSession();