soup_connection_disconnect: assertion 'SOUP_IS_CONNECTION (conn)' failed
I have some problems with python webkitgtk
, I need to capture HTTPS by charles.
Here are my code:
import gi
gi.require_version('WebKit2', '4.0')
gi.require_version("Gtk", "3.0")
from gi.repository import WebKit2, Gtk, Gio
window = Gtk.Window()
window.connect('delete-event',Gtk.main_quit)
context = WebKit2.WebContext.get_default()
context.allow_tls_certificate_for_host(certificate=Gio.TlsCertificate.new_from_file('charles.pem'), host='httpbin.org')
context.set_network_proxy_settings(proxy_mode=WebKit2.NetworkProxyMode.CUSTOM,
proxy_settings=WebKit2.NetworkProxySettings("http://127.0.0.1:8888", None))
view = WebKit2.WebView()
view.load_uri('https://httpbin.org/headers')
window.add(view)
window.show_all()
Gtk.main()
And the console output:
/home/again/webkit2/bin/python /home/again/PycharmProjects/webkit2/test.py
Memory pressure relief: Total: res = 15568896/15425536/-143360, res+swap = 11313152/11313152/0
(process:4575): libsoup-CRITICAL **: 09:51:02.196: soup_connection_disconnect: assertion 'SOUP_IS_CONNECTION (conn)' failed
Memory pressure relief: Total: res = 14090240/13672448/-417792, res+swap = 9633792/9633792/0
Memory pressure relief: Total: res = 13676544/13676544/0, res+swap = 9224192/9224192/0
Memory pressure relief: Total: res = 13672448/13672448/0, res+swap = 9224192/9224192/0
Memory pressure relief: Total: res = 13664256/13664256/0, res+swap = 9220096/9220096/0
Memory pressure relief: Total: res = 13664256/13664256/0, res+swap = 9228288/9228288/0
Memory pressure relief: Total: res = 13856768/13856768/0, res+swap = 9240576/9240576/0
Memory pressure relief: Total: res = 13852672/13852672/0, res+swap = 9240576/9240576/0
Memory pressure relief: Total: res = 13860864/13860864/0, res+swap = 9261056/9261056/0
Memory pressure relief: Total: res = 13860864/13860864/0, res+swap = 9265152/9265152/0
Memory pressure relief: Total: res = 13860864/13860864/0, res+swap = 9265152/9265152/0
Memory pressure relief: Total: res = 13856768/13856768/0, res+swap = 9273344/9273344/0
Memory pressure relief: Total: res = 14262272/13860864/-401408, res+swap = 9687040/9687040/0
It seem that charles capture this HTTPS request, but request not completed! Also unacceptable TLS certificate display on the webview.So, this is a some kind of bug related to proxy_soup_bug?