Skip to content

Commit

Permalink
public key updates
Browse files Browse the repository at this point in the history
  • Loading branch information
corbifex committed May 20, 2024
1 parent 75e6703 commit 21f6129
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions mainnet/Klayr/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"http": "https://service.klayr.xyz",
"ws": "wss://service.klayr.xyz",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
}
],
"explorers": [
Expand All @@ -29,12 +29,12 @@
{
"url": "https://mainnet.klayr.xyz",
"maintainer": "Klayr Labs B.V.",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
},
{
"url": "wss://mainnet.klayr.xyz",
"maintainer": "Klayr Labs B.V.",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
}
]
}
6 changes: 3 additions & 3 deletions testnet/Klayr/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"http": "https://testnet-service.klayr.xyz",
"ws": "wss://testnet-service.klayr.xyz",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
}
],
"explorers": [
Expand All @@ -29,12 +29,12 @@
{
"url": "https://testnet.klayr.xyz",
"maintainer": "Klayr Labs B.V.",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
},
{
"url": "wss://testnet.klayr.xyz",
"maintainer": "Klayr Labs B.V.",
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoWCLObWsqufJm3aOSigy\nvc+kpjE2058UtgBgNfqp7nfcHePMzSpLZrLiILN8m5y0E4UYT4ywLSe7nzzbmLEW\n+BTSItaAPP/cOLPA89VhbmEDQJa2ndfGT5CGP++duvlQ6yH0JHdOkwIpr+o7Mjvs\nSfgIMtALtm5uNOGN4sJSFoNPjXDpskgHi6rOXXifN89wXx38KNCll+tlzUFjOtLR\nZI8ykq+5TDtS9NBJKqIHS3xIQXpXHK63mA9ogmmMwN/4cPh8S+vVUigzdorH6+4m\nFSdE+KfZHc+eK5mr+FfCRJOo6PKMCEeAM1ykBvyX93PwqCndeM+ldL2/EfQvijN+\n+wIDAQAB\n-----END PUBLIC KEY-----"
"apiCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJGfLXBTbkw1rOMnwJwu\nj+a5mPYuSSPy4u+FKZ/e5dkOTL8S+Dv44enmRjR2y/yFQTvUtGwx1hU3Llaa1cgJ\nZSqURBIouueh8hhK6/NDniU2c23ORpBcVYJTaT4035lMmAY4gmT6pCe2X6/aID/c\n7x8P23KcL8D544CJOFEAnQgHvxoQPIyjtQXK7qolbm1F+EzlomGq0atG20wd6hKK\nOptPNQTqv6PN+n3NxPQF3ZeH8ft5Q6rQ1HKfjq3BWkiTOOob4D2eZbc0a880QgEO\nOKLfm4a7SeH70VhIfwch0xyehyv6zWCLVb3HwSFQaTBfYQFcupNTmy53sFAimNq6\nawIDAQAB\n-----END PUBLIC KEY-----"
}
]
}
27 changes: 13 additions & 14 deletions utility/extractPublicKeyFromURL/extractPublicKeyFromURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ const getCertificateFromURL = async (url) => new Promise((resolve, reject) => {
const { host } = new URL(url);

// Use OpenSSL to retrieve the PEM certificate
const command = `openssl s_client -connect ${host}:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM`;

// const command = `openssl s_client -connect ${host}:443 -showcerts 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 &>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > output.pem`;
const command = `openssl s_client -connect ${host}:443 -showcerts 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'`;
exec(command, (error, stdout, stderr) => {
if (error) {
reject(error);
return;
}

if (stderr) {
reject(new Error(`Error: ${stderr}`));
return;
}
if (error) {
reject(error);
return;
}

const pemCertificate = stdout;
resolve(pemCertificate);
});
if (stderr) {
reject(new Error(`Error: ${stderr}`));
return;
}
const pemCertificate = stdout;
resolve(pemCertificate);
});
});

const convertCertificateToPemPublicKey = (pemCertificate) => new Promise((resolve, reject) => {
Expand Down

0 comments on commit 21f6129

Please sign in to comment.