firefoxoptions setpreference to trust certificates

C#
var options = new FirefoxOptions();
options.AddAdditionalCapability("acceptSslCerts", true, true);
options.AddAdditionalCapability("acceptInsecureCerts", true, true);

var  driver = new FirefoxDriver(options);

Source

Also in C#: