Bug 1813827 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Some reference:

0. Geckoview part 
https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#3516-3529

1. How fenix get issuer name:
https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt#1566

Using string subtraction with default format will cause 1) backslash 2)  cannot cleary filter out unneeded info , like L= , St=......

The first question could be solved by using alternative format : `certificate?.issuerX500Principal?.getName(X500Principal.RFC1779) `. (Note:  getIssuerDN is deprecated , use getIssuerX500Principal instead)
but this is not a elegant way and it couldn't solve the second problem.  

The proper way is to use sun.security.x509.X500Name , however this API is not exposed in android.  Or geckview pass issuerOrganization of nsIX509Cert.idl from [js](https://searchfox.org/mozilla-central/source/mobile/android/modules/geckoview/GeckoViewProgress.sys.mjs#144) to [java](https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#3503) then expose via API to Fenix

---
Ref bugs
https://github.com/mozilla-mobile/android-components/issues/5557
https://bugzilla.mozilla.org/show_bug.cgi?id=1795970
Some reference:

0. Geckoview part 
https://searchfox.org/mozilla-central/rev/893f350260faac2ee6bf2b14c627d55eb2babfb0/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#3535-3544

1. How fenix get issuer name:
https://searchfox.org/mozilla-central/rev/893f350260faac2ee6bf2b14c627d55eb2babfb0/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt#1691

Using string subtraction with default format will cause 1) backslash 2)  cannot cleary filter out unneeded info , like L= , St=......

The first question could be solved by using alternative format : `certificate?.issuerX500Principal?.getName(X500Principal.RFC1779) `. (Note:  getIssuerDN is deprecated , use getIssuerX500Principal instead)
but this is not a elegant way and it couldn't solve the second problem.  

The proper way is to use sun.security.x509.X500Name , however this API is not exposed in android.  Or geckview pass issuerOrganization of nsIX509Cert.idl from [js](https://searchfox.org/mozilla-central/source/mobile/android/modules/geckoview/GeckoViewProgress.sys.mjs#144) to [java](https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#3503) then expose via API to Fenix

---
Ref bugs
https://github.com/mozilla-mobile/android-components/issues/5557
https://bugzilla.mozilla.org/show_bug.cgi?id=1795970

Back to Bug 1813827 Comment 4