-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong scrape of Root Certificates (#216)
* Correctly lookup for RootCA * update docs * Scrape all possible root certificate In the uno r4 we're using mbedtls which has a strange behaviour. And some root certificates won't work. Therfore the most simple solution is using all the possible ones, found during the handshake.
- Loading branch information
1 parent
f07445f
commit d945078
Showing
4 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package certificates_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/arduino/arduino-fwuploader/certificates" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestScrapeRootCertificatesFromURL(t *testing.T) { | ||
rootCerts, err := certificates.ScrapeRootCertificatesFromURL("www.arduino.cc:443") | ||
require.NoError(t, err) | ||
for _, cert := range rootCerts { | ||
require.Equal(t, cert.Issuer, cert.Subject) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters