In my case, running selenium in proxy injection mode is not acceptable so I have followed the approach of 'ModHeader' chrome extension to set the custom headers. This approached worked fine for me.
ModHeader Extension: https://github.com/mdamien/chrome-extensions-archive
Here is the code snippet
ChromeOptions chromeOpt = new ChromeOptions();
chromeOpt.addArguments("--no-sandbox");
System.setProperty("webdriver.chrome.args", "--disable-logging");
System.setProperty("webdriver.chrome.silentOutput", "true");
chromeOpt.addExtensions(new File("./ModHeader_v2.2.3.crx"));
WebDriver driver = new ChromeDriver(chromeOpt);
// set the context on the extension so the localStorage can be accessed
driver.get("chrome-extension://idgpnmonknjnojddfkpgkljpfnnfcklj/icon.png");
// setup ModHeader with two headers (token1 and token2)
((JavascriptExecutor)driver).executeScript(
"localStorage.setItem('profiles', JSON.stringify([{ " +
" title: 'Selenium', hideComment: true, appendMode: '', " +
" headers: [ " +
" {enabled: true, name: 'token1', value: 'testHeaderValue1', comment: ''}, " +
" {enabled: true, name: 'token2', value: 'testHeaderValue2', comment: ''} " +
" ], " +
" respHeaders: [], " +
" filters: [] " +
"}])); ");
driver.navigate().to("https://localhost:8443");
Fiddler Custom header snapshot