Selenium+Firefoxでプロキシを使用する

SeleniumでFirefoxにプロキシを設定したい。
FirefoxOptionsクラスにsetProxyメソッドが存在するが、諸事情で使用できない。参考1(https://codeday.me/jp/qa/20190309/389430.html) 参考2(https://github.com/mozilla/geckodriver/issues/764)

上記参考ページと、公式ガイド(https://developer.mozilla.org/ja/docs/Mozilla_Networking_Preferences)を参考に、以下のようにするとhttpsなサイトでのプロキシを有効にできる。

FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("network.proxy.type", 1);
firefoxProfile.setPreference("network.proxy.ssl", HOST);
firefoxProfile.setPreference("network.proxy.ssl_port", PORT);
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setProfile(firefoxProfile);
WebDriver webDriver = new FirefoxDriver(firefoxOptions);

setPreferenceメソッドへのパラメータをnetwork.proxy.socksnetwork.proxy.socks_portの組み合わせを使用した時、Firefox 52 ESRではうまく動作しなかった。