Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: add new SSL certificate (#432)
Browse files Browse the repository at this point in the history
When running the tests I got errors like this:

    Error: error:140AB18E:SSL routines:SSL_CTX_use_certificate:ca md too weak

In order to fix this I created a new certificate. I thought 100 years of
validity might be enough. The command to create it was (based on
https://letsencrypt.org/docs/certificates-for-localhost/):

    openssl req -x509 -out cert.pem -keyout privkey.pem \
      -newkey rsa:2048 -nodes -sha256 \
      -subj '/CN=localhost' -extensions EXT -config <( \
       printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") \
      -days 36524

To verify, run from within *js-ipfs*:

    npx mocha test/core/interface.spec.js --grep 'should add from a HTTPS URL'
  • Loading branch information
vmx authored and Alan Shaw committed Jan 25, 2019
1 parent 44d4803 commit fe539e6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 45 deletions.
34 changes: 16 additions & 18 deletions js/test/fixtures/ssl/cert.pem
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIDOzCCAiMCCQCVqVeRIp9pFDANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJV
UzENMAsGA1UECAwEVXRhaDEOMAwGA1UEBwwFUHJvdm8xIzAhBgNVBAoMGkFDTUUg
U2lnbmluZyBBdXRob3JpdHkgSW5jMRQwEgYDVQQDDAtleGFtcGxlLmNvbTAeFw0x
ODA4MTQyMDEzNTdaFw0xOTEyMjcyMDEzNTdaMFgxCzAJBgNVBAYTAlVTMQ0wCwYD
VQQIDARVdGFoMQ4wDAYDVQQHDAVQcm92bzEWMBQGA1UECgwNQUNNRSBUZWNoIElu
YzESMBAGA1UEAwwJMTI3LjAuMC4xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA6x6mTXV+rC35QW/sPutT1O1cugtnw+UsJx7EGgzyj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15km+Ufhj
X1NGuFqbJOYHfbqOMkgMlkO54y4gAJa5tQnb3n0pNzpIklSzBO65T/u1HAsVDVZW
BgVW/pqourvh6TtjCA3LJp33T9IcItTAlYbiFM0hKytlePzaHG6OKRazO6Z46l/V
gTvRY90B7LrQWnSY3saLYuv9Gs5qQvEvthP/U6LroXjNAgMBAAGjOjA4MBQGA1Ud
EQQNMAuCCWxvY2FsaG9zdDALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUH
AwEwDQYJKoZIhvcNAQELBQADggEBAJHi6CJk5aZViLK+dm/ruV2vBiqGuRgfuviJ
Mb+iApO39Q/PjxE2IQoVVcf7Rpml2SSARyN7K9cxLdSFFZn3Wgq3yHXB6vhsyGO+
r17awBEI08PUlCuYVlE/mEzHGUGYbR0whIQSWK+gLMSQ2NG11DJyIPnErZYM1XSS
p9ERjyR4KXC33RxEc0AtGZsGgCThGkmwas3v702pzGfDd3qpbXztb+jdbfUVMUj4
Wrzhps9JZ6HJ8RZBjnSMMqmWDbvJI+2aG0Ky6BYChrARLn9H7rCMgfe0l0QIL5br
T1BqL+HHCVNiyt82+byg5mjpcsKvojCrQVVcQBs1xUkk6F45LeU=
-----END CERTIFICATE-----
55 changes: 28 additions & 27 deletions js/test/fixtures/ssl/privkey.pem
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA6x6mTXV+rC35QW/sPutT1O1cugtnw+UsJx7EGgzyjh7EoXE3
gb7sO96PtOI5zknb0vecckbiVkesmLnAs2iNa1u9EiRr6WHdc+1MfUCxyHRfP731
vRZyo0kxbSXerE0qZ2N3M1XyndZF7VMthKDKIg0ZR0TvdjwLqyLYEHAnRBhJLRS0
Oy0fC6OfVWCO3gIuk1HkTXH+/ZMA/obqrtlisxY85mMdlRz+1PNdZBMf+NxmrXN5
9uq+JqUu8/v1oQ8jH2iU9IWeqyawHDEvPW3aDorfaWGyats5Xd3cT2Ph4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