diff --git a/plugins/redfish/fu-plugin-redfish.c b/plugins/redfish/fu-plugin-redfish.c index a9047851e..15ecdecd7 100644 --- a/plugins/redfish/fu-plugin-redfish.c +++ b/plugins/redfish/fu-plugin-redfish.c @@ -52,6 +52,7 @@ fu_plugin_startup (FuPlugin *plugin, GError **error) FuPluginData *data = fu_plugin_get_data (plugin); GBytes *smbios_data = fu_plugin_get_smbios_data (plugin, REDFISH_SMBIOS_TABLE_TYPE); g_autofree gchar *redfish_uri = NULL; + g_autofree gchar *ca_check = NULL; /* read the conf file */ redfish_uri = fu_plugin_get_config_value (plugin, "Uri"); @@ -103,6 +104,13 @@ fu_plugin_startup (FuPlugin *plugin, GError **error) return FALSE; } } + + ca_check = fu_plugin_get_config_value (plugin, "CACheck"); + if (ca_check != NULL && g_ascii_strcasecmp (ca_check, "false") == 0) + fu_redfish_client_set_cacheck (data->client, FALSE); + else + fu_redfish_client_set_cacheck (data->client, TRUE); + return fu_redfish_client_setup (data->client, smbios_data, error); } diff --git a/plugins/redfish/fu-redfish-client.c b/plugins/redfish/fu-redfish-client.c index 267052bb6..269b184cf 100644 --- a/plugins/redfish/fu-redfish-client.c +++ b/plugins/redfish/fu-redfish-client.c @@ -31,6 +31,7 @@ struct _FuRedfishClient gchar *push_uri_path; gboolean auth_created; gboolean use_https; + gboolean cacheck; GPtrArray *devices; }; @@ -671,6 +672,12 @@ fu_redfish_client_setup (FuRedfishClient *self, GBytes *smbios_table, GError **e return FALSE; } + if (self->cacheck == FALSE) { + g_object_set (G_OBJECT (self->session), + SOUP_SESSION_SSL_STRICT, FALSE, + NULL); + } + /* this is optional */ if (smbios_table != NULL) { g_autoptr(GError) error_smbios = NULL; @@ -781,6 +788,12 @@ fu_redfish_client_set_https (FuRedfishClient *self, gboolean use_https) self->use_https = use_https; } +void +fu_redfish_client_set_cacheck (FuRedfishClient *self, gboolean cacheck) +{ + self->cacheck = cacheck; +} + void fu_redfish_client_set_username (FuRedfishClient *self, const gchar *username) { diff --git a/plugins/redfish/fu-redfish-client.h b/plugins/redfish/fu-redfish-client.h index 3766ffed6..f4d9d026c 100644 --- a/plugins/redfish/fu-redfish-client.h +++ b/plugins/redfish/fu-redfish-client.h @@ -28,6 +28,8 @@ void fu_redfish_client_set_port (FuRedfishClient *self, guint port); void fu_redfish_client_set_https (FuRedfishClient *self, gboolean use_https); +void fu_redfish_client_set_cacheck (FuRedfishClient *self, + gboolean cacheck); gboolean fu_redfish_client_update (FuRedfishClient *self, FuDevice *device, GBytes *blob_fw, diff --git a/plugins/redfish/redfish.conf b/plugins/redfish/redfish.conf index 71b98c55e..ee879e3bd 100644 --- a/plugins/redfish/redfish.conf +++ b/plugins/redfish/redfish.conf @@ -7,3 +7,8 @@ # The username and password to the Redfish service #Username= #Password= + +# Whether to verify the server certificate or not +# Expected value: TRUE or FALSE +# Default: TRUE +#CACheck=