Desktop & Extension Viewers
Use Certeno's React or vanilla viewer with the CRL/OCSP revocation plugin inside Electron, Tauri, and browser-extension hosts. In a normal web page the browser blocks direct CRL/OCSP requests, so online revocation needs a server-side proxy. In these hosts you have a native network layer instead — so you can drop the proxy and let the app itself perform the fetch.
Why a bridge is needed (not a proxy server)
Deciding what a CRL or OCSP response means happens inside Certeno's engine and runs anywhere. What a plain web page cannot do is fetch the CRL/OCSP endpoint, because of three browser walls:
- CORS — CA revocation servers do not send
Access-Control-Allow-Origin, so the browser blocks the response. - Mixed content — many CRL/OCSP URLs are
http://, blocked from anhttps://page. - OCSP preflight — OCSP is a
POSTwith a non-simple content type, triggering a CORS preflight the servers don't answer.
The fix is never "move more code to a server" — it is "run the fetch in a context without CORS." Electron's main process, Tauri's Rust backend, and an extension's background worker are exactly such contexts. You keep the viewer in the front end and bridge only the network call.
That is all a revocation plugin is: one function, fetch(request), that makes a download and returns the bytes. The engine tells it what to fetch ({ kind: 'crl', url } or { kind: 'ocsp', url, body }) and judges what comes back — signature, subject, dates — so a bridge carries bytes and decides nothing.
Electron
Make the download in the main process (Node — no CORS) and bridge to it over IPC. No external server needed.
Main process — expose the shipped fetch function:
// electron/main.ts
import { ipcMain } from 'electron'
import { fetchRevocation } from '@trexolab/certeno-plugin-revocation/handler/core'
// Applies the SSRF URL filter, makes the download, returns Uint8Array | null.
ipcMain.handle('ct:revocation', (_event, request) => fetchRevocation(request))Preload — expose a typed bridge to the renderer:
// electron/preload.ts
import { contextBridge, ipcRenderer } from 'electron'
import type { RevocationFetchRequest } from '@trexolab/certeno-core'
contextBridge.exposeInMainWorld('ctRevocation', {
fetch: (request: RevocationFetchRequest): Promise<Uint8Array | null> =>
ipcRenderer.invoke('ct:revocation', request),
})Renderer — a tiny custom plugin that forwards to the bridge, then pass it to the viewer:
import type { CertenoPlugin, RevocationFetchRequest } from '@trexolab/certeno-core'
declare global {
interface Window {
ctRevocation: { fetch(request: RevocationFetchRequest): Promise<Uint8Array | null> }
}
}
const revocationBridgePlugin: CertenoPlugin = {
name: 'revocation',
revocation: {
fetch: (request) => window.ctRevocation.fetch(request),
},
}
// React: <CertenoProvider config={{ plugins: [revocationBridgePlugin] }}>
// Vanilla: Certeno.create(el, { plugins: [revocationBridgePlugin] })Electron's IPC uses structured clone, so the Uint8Array in an OCSP request and in the response cross it intact.
Avoid
webPreferences: { webSecurity: false }to "make fetch work" — it disables same-origin protection app-wide. The IPC bridge is safer and needs no external server.
Tauri
Tauri's webview enforces CORS like any browser, so route the fetch through the Rust backend.
Option A — global fetch swap (simplest). @tauri-apps/plugin-http provides a fetch that runs in Rust (no CORS). Install it, then route all fetch through it once at startup; the built-in revocationPlugin() (direct mode, no endpoint) then works unchanged:
// main.tsx — run once, before creating the verifier
import { fetch as tauriFetch } from '@tauri-apps/plugin-http'
globalThis.fetch = tauriFetch as typeof globalThis.fetch
import { revocationPlugin } from '@trexolab/certeno-plugin-revocation'
const plugins = [revocationPlugin()] // no endpoint → direct, now CORS-freeAlso allow the CRL/OCSP hosts in your Tauri capabilities (src-tauri/capabilities/*.json, the http:default permission scope) and in the tauri.conf.json CSP connect-src.
Option B — Rust command. If you would rather not replace the global fetch, make the download in a #[tauri::command] and invoke it from a custom plugin:
import { invoke } from '@tauri-apps/api/core'
import type { CertenoPlugin } from '@trexolab/certeno-core'
const revocationBridgePlugin: CertenoPlugin = {
name: 'revocation',
revocation: {
fetch: async (request) => {
const bytes = await invoke<number[] | null>('ct_fetch_revocation', {
kind: request.kind,
url: request.url,
body: request.kind === 'ocsp' ? Array.from(request.body) : null,
})
return bytes ? new Uint8Array(bytes) : null
},
},
}The Rust ct_fetch_revocation command does a GET for kind: "crl", or a POST of body with Content-Type: application/ocsp-request for kind: "ocsp" (e.g. with reqwest), and returns the response body. It does not need to parse anything — and should apply an allowlist of hosts, since it fetches a URL the document supplied.
Browser extension (MV3)
An extension's background service worker can fetch cross-origin for any host listed in host_permissions — CORS does not apply there. Make the download in the background and message it from the viewer.
Manifest — declare host access:
{
"manifest_version": 3,
"host_permissions": ["http://*/*", "https://*/*"],
"background": { "service_worker": "background.js" }
}Background — reuse the shipped handler. Extension messages are JSON, which has no bytes, so this side speaks the same JSON the HTTP proxy does (processRevocation) and sends the response back as an array of numbers:
// background.ts
import { processRevocation } from '@trexolab/certeno-plugin-revocation/handler/core'
chrome.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
if (msg?.kind === 'ct:revocation') {
processRevocation(msg.payload) // never throws
.then((result) => sendResponse(result.ok ? Array.from(result.body) : null))
return true // keep the channel open for the async response
}
})Viewer (extension page or content script) — bridge plugin:
import type { CertenoPlugin } from '@trexolab/certeno-core'
const toBase64 = (bytes: Uint8Array) => btoa(Array.from(bytes, (b) => String.fromCharCode(b)).join(''))
const revocationBridgePlugin: CertenoPlugin = {
name: 'revocation',
revocation: {
fetch: async (request) => {
const payload = request.kind === 'ocsp'
? { kind: 'ocsp', url: request.url, body: toBase64(request.body) }
: { kind: 'crl', url: request.url }
const bytes: number[] | null = await chrome.runtime.sendMessage({ kind: 'ct:revocation', payload })
return bytes ? new Uint8Array(bytes) : null
},
},
}Security notes
- A bridge cannot make a signature look better than it is. Whatever it returns still has to be signed by the certificate's CA (or an authorised OCSP responder) to count; anything else is ignored. A bridge that returns nothing, or garbage, leaves the certificate's revocation status
unknown(shown as "validity unknown"), never a false "valid". See Revocation Checking and Security. - A bridge does fetch a URL that came out of a document.
fetchRevocationandprocessRevocationapply the default SSRFurlFilter, which blocks common private/internal hosts (10.x,192.168.x,172.16–31.x,*.internal,*.local,localhost), but it does not cover cloud-metadata / link-local ranges (e.g.169.254.169.254, IPv6fe80::/10andfc00::/7) and it allows all other public hosts. For an internal/enterprise PKI — or to block cloud-metadata endpoints — pass a customurlFilter(allowlist) in the options. If you write the fetch yourself (Tauri Option B), the filtering is yours to do. - Both functions return a body only when it is structurally a CRL or an OCSP response, so the bridge is not a general-purpose way to read arbitrary URLs from the page.
Which platform needs what
| Host | Where the fetch runs | What to add |
|---|---|---|
| Browser (web page) | — (blocked by CORS) | A proxy server (handleRevocation) or embedded LTV/DSS |
| Electron | Main process (Node) | ipcMain → fetchRevocation + preload bridge + custom plugin |
| Tauri | Rust backend | plugin-http global-fetch swap (A) or a Rust command (B) |
| Browser extension | Background service worker | host_permissions + chrome.runtime message + custom plugin |
| Node / SSR | In-process | revocationPlugin() direct mode (no bridge) |