-
Notifications
You must be signed in to change notification settings - Fork 273
Add https functionality #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f156d7
Made https work, altough very unpolished yet
mumme74 5a57d61
Add .gitignore
mumme74 f857b20
More changes, got https to work
mumme74 6f98b47
Added https functionality to GUI
mumme74 b636f16
Cleanup
mumme74 a778e67
More cleanup before pull request
mumme74 3e20c13
Do suggestions from maintainer during pull request.
mumme74 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| **/node_modules | ||
| **/package-lock.json | ||
| react-ui/nojsx | ||
| wsc-chrome.min.js | ||
| assets | ||
| package.json | ||
| package.zip |
This file contains hidden or 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 hidden or 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 hidden or 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,74 @@ | ||
| (function() { | ||
|
|
||
| // function to create certificate | ||
| var createCrypto = function(cn, data) { | ||
| console.log( | ||
| 'Generating 1024-bit key-pair and certificate for \"' + cn + '\".'); | ||
| var keys = forge.pki.rsa.generateKeyPair(1024); | ||
| console.log('key-pair created.'); | ||
|
|
||
| var cert = forge.pki.createCertificate(); | ||
| cert.serialNumber = '01'; | ||
| cert.validity.notBefore = new Date(); | ||
| cert.validity.notAfter = new Date(); | ||
| cert.validity.notAfter.setFullYear( | ||
| cert.validity.notBefore.getFullYear() + 10); | ||
| var attrs = [{ | ||
| name: 'commonName', | ||
| value: cn | ||
| }, { | ||
| name: 'countryName', | ||
| value: 'SE' | ||
| }, { | ||
| shortName: 'ST', | ||
| value: 'test-st' | ||
| }, { | ||
| name: 'localityName', | ||
| value: 'testing server' | ||
| }, { | ||
| name: 'organizationName', | ||
| value: 'Web server for chrome' | ||
| }, { | ||
| shortName: 'OU', | ||
| value: 'WSC' | ||
| }]; | ||
| cert.setSubject(attrs); | ||
| cert.setIssuer(attrs); | ||
| cert.setExtensions([{ | ||
| name: 'basicConstraints', | ||
| cA: true | ||
| }, { | ||
| name: 'keyUsage', | ||
| keyCertSign: true, | ||
| digitalSignature: true, | ||
| nonRepudiation: true, | ||
| keyEncipherment: true, | ||
| dataEncipherment: true | ||
| }, { | ||
| name: 'subjectAltName', | ||
| altNames: [{ | ||
| type: 6, // URI | ||
| value: 'http://localhost' | ||
| }] | ||
| }]); | ||
| // FIXME: add subjectKeyIdentifier extension | ||
| // FIXME: add authorityKeyIdentifier extension | ||
| cert.publicKey = keys.publicKey; | ||
|
|
||
| // self-sign certificate | ||
| cert.sign(keys.privateKey, forge.md.sha256.create()); | ||
|
|
||
| // save data | ||
| data[cn] = { | ||
| cert: forge.pki.certificateToPem(cert), | ||
| privateKey: forge.pki.privateKeyToPem(keys.privateKey) | ||
| }; | ||
|
|
||
| return data; | ||
| console.log('certificate created for \"' + cn + '\": \n'); | ||
| }; | ||
|
|
||
| WSC.createCrypto = (name, data) => { return createCrypto(name, data || {}); } | ||
|
|
||
| })(); | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| cat "underscore.js" "encoding.js" "common.js" "log-full.js" "mime.js" "buffer.js" "request.js" "stream.js" "chromesocketxhr.js" "connection.js" "webapp.js" "websocket.js" "upnp.js" "handlers.js" "httplib.js" > wsc-chrome.min.js | ||
| cat "underscore.js" "encoding.js" "common.js" "log-full.js" "mime.js" "buffer.js" "request.js" "crypto.js" "stream.js" "chromesocketxhr.js" "connection.js" "webapp.js" "websocket.js" "upnp.js" "handlers.js" "httplib.js" > wsc-chrome.min.js |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.