File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -673,8 +673,9 @@ export class AdminRoomHandler {
673673 new MatrixUser ( userId ) , server . domain
674674 ) ;
675675 }
676+ let c : crypto . X509Certificate ;
676677 try {
677- const c = new crypto . X509Certificate ( cert ) ;
678+ c = new crypto . X509Certificate ( cert ) ;
678679 const pk = config . getSASLKey ( ) ;
679680 if ( pk ) {
680681 if ( ! c . checkPrivateKey ( crypto . createPrivateKey ( pk ) ) ) {
@@ -689,10 +690,13 @@ export class AdminRoomHandler {
689690 catch ( err ) {
690691 throw new Error ( `Invalid certificate: ${ err . message } )` ) ;
691692 }
693+ const fingerprint512 = crypto . createHash ( 'sha512' ) . update ( c . raw ) . digest ( 'hex' )
694+ . replace ( / : / g, '' ) . toLowerCase ( ) ;
692695 config . setSASLCert ( cert ) ;
693696 await this . ircBridge . getStore ( ) . storeIrcClientConfig ( config ) ;
694697 notice = new MatrixAction (
695- "notice" , `Successfully stored SASL cert for ${ domain } . Use !reconnect to reauthenticate.`
698+ "notice" , `Successfully stored SASL cert for ${ domain } with fingerprint ${ fingerprint512 } .\n' +
699+ 'Use !reconnect to reauthenticate.`
696700 ) ;
697701 }
698702 }
You can’t perform that action at this time.
0 commit comments