Skip to content

Commit

Permalink
fix Windows Crypto API error
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Sep 12, 2024
1 parent 77ebf47 commit e00c70e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/electron/go_vpn_tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ class GoTun2socks {
*/
async function checkConnectivity(tun2socks: GoTun2socks) {
const output = await tun2socks.checkConnectivity();
const outObj = JSON.parse(output);
// Only parse the first line, because sometimes Windows Crypto API adds random logs to stdout.
const outObj = JSON.parse(output.split('\n')[0]);
if ('tcpErrorJson' in outObj && outObj.tcpErrorJson) {
throw new Error(outObj.tcpErrorJson);
}
Expand Down

0 comments on commit e00c70e

Please sign in to comment.