1
0
Fork 0

- [GUI] fixed deletion of old certificates when a mismatch with the cached ones occurred.

This commit is contained in:
cage 2023-05-18 19:08:34 +02:00
parent ad06c1b231
commit 329d2d32d1
2 changed files with 4 additions and 3 deletions

View File

@ -863,7 +863,7 @@
(let ((actual-iri (get-user-request-query iri meta main-window :sensitive t))) (let ((actual-iri (get-user-request-query iri meta main-window :sensitive t)))
(start-stream-iri actual-iri main-window nil))) (start-stream-iri actual-iri main-window nil)))
((= status-code comm:+tofu-error-status-code+) ((= status-code comm:+tofu-error-status-code+)
(when (gui:ask-yesno meta (when (gui:ask-yesno (_ "The certificate for this address has changed, replace the old with the one jut got?")
:title (_ "Server certificate error") :title (_ "Server certificate error")
:parent main-window) :parent main-window)
(cev:enqueue-request-and-wait-results :gemini-delete-certificate (cev:enqueue-request-and-wait-results :gemini-delete-certificate

View File

@ -46,8 +46,9 @@
(db:cache-invalidate cache-key) (db:cache-invalidate cache-key)
t) t)
(defun gemini-delete-certificate (cache-key) (defun gemini-delete-certificate (iri)
(invalidate-cached-value cache-key)) (let ((host (uri:host (iri:iri-parse iri))))
(db:tofu-delete host)))
(defun gemini-import-certificate (uri cert-file key-file) (defun gemini-import-certificate (uri cert-file key-file)
(db-utils:with-ready-database (:connect nil) (db-utils:with-ready-database (:connect nil)