mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-06-25 15:01:36 +02:00
Compare commits
7 Commits
2.3.3
...
esp32-ssl-
Author | SHA1 | Date | |
---|---|---|---|
f6e730c2b4 | |||
7c3b1b7408 | |||
738e43fda4 | |||
f55bf8d4ed | |||
a484da47ed | |||
4355199120 | |||
3a2b757155 |
12
.github/workflows/main.yml
vendored
12
.github/workflows/main.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
prepare_example_json:
|
prepare_example_json:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: generate examples
|
- name: generate examples
|
||||||
@ -60,7 +60,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IDE_VERSION: ${{ matrix.IDE_VERSION }}
|
IDE_VERSION: ${{ matrix.IDE_VERSION }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Get Date
|
- name: Get Date
|
||||||
@ -121,6 +121,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: install libgtk2.0-0
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y libgtk2.0-0
|
||||||
|
|
||||||
- name: Get Date
|
- name: Get Date
|
||||||
id: get-date
|
id: get-date
|
||||||
run: |
|
run: |
|
||||||
@ -134,7 +138,7 @@ jobs:
|
|||||||
/home/runner/arduino_ide
|
/home/runner/arduino_ide
|
||||||
/home/runner/Arduino
|
/home/runner/Arduino
|
||||||
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ matrix.ideversion }}
|
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ matrix.ideversion }}
|
||||||
|
|
||||||
- name: install python serial
|
- name: install python serial
|
||||||
if: matrix.cpu == 'esp32'
|
if: matrix.cpu == 'esp32'
|
||||||
run: |
|
run: |
|
||||||
@ -157,7 +161,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p $HOME/Arduino/libraries/
|
mkdir -p $HOME/Arduino/libraries/
|
||||||
cp -r $GITHUB_WORKSPACE $HOME/Arduino/libraries/arduinoWebSockets
|
cp -r $GITHUB_WORKSPACE $HOME/Arduino/libraries/arduinoWebSockets
|
||||||
|
|
||||||
- name: config IDE
|
- name: config IDE
|
||||||
run: |
|
run: |
|
||||||
export DISPLAY=:1.0
|
export DISPLAY=:1.0
|
||||||
|
@ -21,5 +21,5 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Links2004/arduinoWebSockets.git"
|
"url": "https://github.com/Links2004/arduinoWebSockets.git"
|
||||||
},
|
},
|
||||||
"version": "2.3.3"
|
"version": "2.3.5"
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
name=WebSockets
|
name=WebSockets
|
||||||
version=2.3.3
|
version=2.3.5
|
||||||
author=Markus Sattler
|
author=Markus Sattler
|
||||||
maintainer=Markus Sattler
|
maintainer=Markus Sattler
|
||||||
sentence=WebSockets for Arduino (Server + Client)
|
sentence=WebSockets for Arduino (Server + Client)
|
||||||
|
@ -229,8 +229,11 @@ void WebSocketsClient::loop(void) {
|
|||||||
#else
|
#else
|
||||||
#error setCACert not implemented
|
#error setCACert not implemented
|
||||||
#endif
|
#endif
|
||||||
#if defined(SSL_BARESSL)
|
#if defined(ESP32)
|
||||||
} else if(_fingerprint) {
|
} else if(!SSL_FINGERPRINT_IS_SET) {
|
||||||
|
_client.ssl->setInsecure();
|
||||||
|
#elif defined(SSL_BARESSL)
|
||||||
|
} else if(SSL_FINGERPRINT_IS_SET) {
|
||||||
_client.ssl->setFingerprint(_fingerprint);
|
_client.ssl->setFingerprint(_fingerprint);
|
||||||
} else {
|
} else {
|
||||||
_client.ssl->setInsecure();
|
_client.ssl->setInsecure();
|
||||||
@ -865,14 +868,14 @@ void WebSocketsClient::connectedCb() {
|
|||||||
|
|
||||||
#if defined(HAS_SSL)
|
#if defined(HAS_SSL)
|
||||||
#if defined(SSL_AXTLS) || defined(ESP32)
|
#if defined(SSL_AXTLS) || defined(ESP32)
|
||||||
if(_client.isSSL && _fingerprint.length()) {
|
if(_client.isSSL && SSL_FINGERPRINT_IS_SET) {
|
||||||
if(!_client.ssl->verify(_fingerprint.c_str(), _host.c_str())) {
|
if(!_client.ssl->verify(_fingerprint.c_str(), _host.c_str())) {
|
||||||
DEBUG_WEBSOCKETS("[WS-Client] certificate mismatch\n");
|
DEBUG_WEBSOCKETS("[WS-Client] certificate mismatch\n");
|
||||||
WebSockets::clientDisconnect(&_client, 1000);
|
WebSockets::clientDisconnect(&_client, 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(_client.isSSL && _fingerprint) {
|
if(_client.isSSL && SSL_FINGERPRINT_IS_SET) {
|
||||||
#endif
|
#endif
|
||||||
} else if(_client.isSSL && !_CA_cert) {
|
} else if(_client.isSSL && !_CA_cert) {
|
||||||
#if defined(SSL_BARESSL)
|
#if defined(SSL_BARESSL)
|
||||||
|
@ -112,12 +112,14 @@ class WebSocketsClient : protected WebSockets {
|
|||||||
#ifdef SSL_AXTLS
|
#ifdef SSL_AXTLS
|
||||||
String _fingerprint;
|
String _fingerprint;
|
||||||
const char * _CA_cert;
|
const char * _CA_cert;
|
||||||
|
#define SSL_FINGERPRINT_IS_SET (_fingerprint.length())
|
||||||
#define SSL_FINGERPRINT_NULL ""
|
#define SSL_FINGERPRINT_NULL ""
|
||||||
#else
|
#else
|
||||||
const uint8_t * _fingerprint;
|
const uint8_t * _fingerprint;
|
||||||
BearSSL::X509List * _CA_cert;
|
BearSSL::X509List * _CA_cert;
|
||||||
BearSSL::X509List * _client_cert;
|
BearSSL::X509List * _client_cert;
|
||||||
BearSSL::PrivateKey * _client_key;
|
BearSSL::PrivateKey * _client_key;
|
||||||
|
#define SSL_FINGERPRINT_IS_SET (_fingerprint != NULL)
|
||||||
#define SSL_FINGERPRINT_NULL NULL
|
#define SSL_FINGERPRINT_NULL NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file WebSocketsVersion.h
|
* @file WebSocketsVersion.h
|
||||||
* @date 07.01.2021
|
* @date 09.02.2021
|
||||||
* @author Markus Sattler
|
* @author Markus Sattler
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Markus Sattler. All rights reserved.
|
* Copyright (c) 2015 Markus Sattler. All rights reserved.
|
||||||
@ -25,12 +25,12 @@
|
|||||||
#ifndef WEBSOCKETSVERSION_H_
|
#ifndef WEBSOCKETSVERSION_H_
|
||||||
#define WEBSOCKETSVERSION_H_
|
#define WEBSOCKETSVERSION_H_
|
||||||
|
|
||||||
#define WEBSOCKETS_VERSION "2.3.3"
|
#define WEBSOCKETS_VERSION "2.3.5"
|
||||||
|
|
||||||
#define WEBSOCKETS_VERSION_MAJOR 2
|
#define WEBSOCKETS_VERSION_MAJOR 2
|
||||||
#define WEBSOCKETS_VERSION_MINOR 3
|
#define WEBSOCKETS_VERSION_MINOR 3
|
||||||
#define WEBSOCKETS_VERSION_PATCH 3
|
#define WEBSOCKETS_VERSION_PATCH 5
|
||||||
|
|
||||||
#define WEBSOCKETS_VERSION_INT 2003003
|
#define WEBSOCKETS_VERSION_INT 2003005
|
||||||
|
|
||||||
#endif /* WEBSOCKETSVERSION_H_ */
|
#endif /* WEBSOCKETSVERSION_H_ */
|
||||||
|
Reference in New Issue
Block a user