Be less strict on SSL: add an option instead?

This commit is contained in:
Benjamin Drieu 2022-03-21 12:10:05 +01:00 committed by Benjamin Drieu
parent d5f975ce44
commit e52a346369

View File

@ -52,14 +52,24 @@ class GenericServer {
buildURL ( ) buildURL ( )
{ {
if ( ! this._settings ) // if ( ! this._settings )
this._settings = Preferences.getAccountSettings ( this._server ); this._settings = Preferences.getAccountSettings ( this._server );
this.type = this._settings.get_string ( "type" ); if ( this.type != this._settings.get_string ( "type" ) ||
this.username = this._settings.get_string ( "username" ); this.username != this._settings.get_string ( "username" ) ||
this.name = this._settings.get_string ( "name" ); this.strict_ssl != this._settings.get_boolean ( "strict-ssl" ) ||
this.password = this._settings.get_string ( "password" ); this.name != this._settings.get_string ( "name" ) ||
this.urlcgi = this._settings.get_string ( "urlcgi" ); this.password != this._settings.get_string ( "password" ) ||
this.urlcgi != this._settings.get_string ( "urlcgi" ) )
{
this.type = this._settings.get_string ( "type" );
this.username = this._settings.get_string ( "username" );
this.strict_ssl = this._settings.get_boolean ( "strict-ssl" );
this.name = this._settings.get_string ( "name" );
this.password = this._settings.get_string ( "password" );
this.urlcgi = this._settings.get_string ( "urlcgi" );
this._httpSession = null;
}
// log ( 'monito server >>> ' + this._server ); // log ( 'monito server >>> ' + this._server );
// log ( 'monito name >>> ' + this.name ); // log ( 'monito name >>> ' + this.name );
@ -73,6 +83,7 @@ class GenericServer {
{ {
if ( this._httpSession == null ) { if ( this._httpSession == null ) {
this._httpSession = new Soup.Session(); this._httpSession = new Soup.Session();
this._httpSession.ssl_strict = this.strict_ssl;
this._httpSession.user_agent = Me.metadata.uuid; this._httpSession.user_agent = Me.metadata.uuid;
} }
} }