Skip to content

MEN-3730 all server communication via openssl#581

Merged
merlin-northern merged 1 commit intomendersoftware:masterfrom
merlin-northern:men_3730_all_server_communication_via_openssl
Aug 7, 2020
Merged

MEN-3730 all server communication via openssl#581
merlin-northern merged 1 commit intomendersoftware:masterfrom
merlin-northern:men_3730_all_server_communication_via_openssl

Conversation

@merlin-northern
Copy link
Contributor

@merlin-northern merlin-northern commented Aug 3, 2020

MEN-3730 Switch all client crypto operations over to OpenSSL.

https://tracker.mender.io/browse/MEN-3730

Note: goes with meta-mender/pull/1052
spin offs:

ChangeLog: Switch to OpenSSL for all server communication.
Signed-off-by: Peter Grzybowski peter@northern.tech

@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-173902074

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from 0044d01 to bd72a91 Compare August 3, 2020 22:13
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-173906117

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern merlin-northern requested a review from a user August 4, 2020 06:35
@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from bd72a91 to e02f06e Compare August 4, 2020 07:39
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174015540

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from e02f06e to a86277f Compare August 4, 2020 07:48
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174018823

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@mchalski
Copy link
Contributor

mchalski commented Aug 4, 2020

@merlin-northern accidentally added client/.client_update.go.swp - I can't make a comment on the file so writing here :)

@merlin-northern
Copy link
Contributor Author

@merlin-northern accidentally added client/.client_update.go.swp - I can't make a comment on the file so writing here :)

wow. thanks!
I bet important code there.

Copy link
Contributor

@mchalski mchalski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me at least.
I'd wait for a review from core client devs though (if it's possible in reasonable time)

@merlin-northern
Copy link
Contributor Author

it looks good to me at least.
I'd wait for a review from core client devs though (if it's possible in reasonable time)

thanks!

Copy link
Member

@lluiscampos lluiscampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here my round of comments and questions.

We should have the meta-mender PR in place to merge both at the same time. Let me know if you need help with yocto!

I am not an TLS expert... I hope @alfrunes can provide more technical feedback.

Other nitpicks:

  • The two first commits (implementation and tests) should be combined together IMO. Specially for change sets that include new golang dependencies, there is a chance that these are not in Debian and we need to revert the change. In that case, a single patch is better than two :)
  • You don't need the JIRA link in the commit message (changelog-generator creates it for you if you have a MEN-XXXX reference). It doesn't hurt, though, so it is just FYI.

Comment on lines +298 to +301
conn, err := openssl.Dial("tcp", addr, contextSSL, flags)
if conn == nil || err != nil {
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm. could we have conn == nil and err == nil? In that case the return would not make sense, we would need two different ones:

Suggested change
conn, err := openssl.Dial("tcp", addr, contextSSL, flags)
if conn == nil || err != nil {
return nil, err
}
conn, err := openssl.Dial("tcp", addr, contextSSL, flags)
if err != nil {
return nil, err
}
if con == nil {
...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm. could we have conn == nil and err == nil? In that case the return would not make sense, we would need two different ones:

no chance for that. I checked that every time DialSession returns only nil,err (where err!=nil) or conn,nil (where conn!=nil)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would only check for err. The if condition is somewhat dangerous as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do! thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment on lines +556 to +558
//if ts.EnableHTTP2 { // to be uncommented when go version is updated in build_servers
// nextProtos = []string{"h2"}
//}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment; the golang version for the client is defined by yocto, no relation with the build_servers. Better to specify from which golang version on can we uncomment this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will reword that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove this comment. httptest.NewUnstartedServer returns a structure where this field is false anyway. From the docs:

EnableHTTP2 [...] It must be set between calling
NewUnstartedServer and calling Server.StartTLS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to reword the comment.
Alf, if you insist on removing that, I have no problem with that. I can also add:

 if runtime.Version() == "go1.12" { ... }

I wonder if that would work? but I would like to avoid it, since it leads to good old #ifdef __PLATFORM__ ... #endif mess.

Comment on lines +96 to +99
}),
localhostCert,
localhostKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation here is strange

Copy link
Contributor Author

@merlin-northern merlin-northern Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blame go fmt ;-) I can change it to your liking :) I will try.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer having a line with the same number of closing brackets on a single line as an opposing line introduces. IOW, if you add a newline after startTestHTTPS( the indentation should look OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! thanks. looks really better.

}))
}),
localhostCert,
localhostKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all these tests, we use a cert loaded from string (from tests_start_https.go) and also as a filename parameter for NewApiClient. I wonder if we can eliminate the duplication by making startTestHTTPS read the certs from the disk.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am missing something, as some tests do use different certs for startTestHTTPS and NewApiClient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thats the main idea. different certs combinations trigger different errors handled in dialOpenSSL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey.

But still the strings at startTestHTTPS could be loaded from the files instead of duplicating the certs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do what I can!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I took another look, Lluis maybe we can keep it like that? every certificate in https_server_test.go (was: tests_start_https.go) is different, I mean all the variables:

var localhostCertUnknown
var localhostKeyUnknown
var localhostCertExpired
var localhostKeyExpired
var localhostCert
var localhostKey
var localhostCertShortEEKey
var localhostKeyShortEEKey

hold different data, to trigger different errors in verification. if you insist I will load them form files, but you will have to convince me :) what are the benefits here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that, for example, var localhostCertExpired is the same content as file client/server.expired.crt. So for these (variables that are duplicated in files) we could just read the files.

It is not a big deal anyway, leave it as-is if you like it more.

@merlin-northern
Copy link
Contributor Author

We should have the meta-mender PR in place to merge both at the same time. Let me know if you need help with yocto!

I have no idea if that is the correct place

@@ -0,0 +1,565 @@
// Copyright 2020 Northern.tech AS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: please change the filename to something ending in _test.go (e.g. https_server_test.go) so that the symbols won't be defined when running go build (also, this will contribute to the test coverage).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment on lines +556 to +558
//if ts.EnableHTTP2 { // to be uncommented when go version is updated in build_servers
// nextProtos = []string{"h2"}
//}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove this comment. httptest.NewUnstartedServer returns a structure where this field is false anyway. From the docs:

EnableHTTP2 [...] It must be set between calling
NewUnstartedServer and calling Server.StartTLS.

}
rsp, err := client.Request(ac, ts.URL, msger)
assert.Error(t, err)
assert.Contains(t, err.Error(), "end entity key too short")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious and tried to run these tests locally. However, this test failed with the following error:

    client_auth_test.go:223: 
        	Error Trace:	client_auth_test.go:223
        	Error:      	"generic error occurred while executing authorization request: Post \"https://127.0.0.1:41371/api/devices/v1/authentication/auth_requests\": depth zero self-signed certificate, openssl verify rc: 18 server cert file: server.crt" does not contain "end entity key too short"
        	Test:       	TestClientAuthEndEntityKeyTooSmall
--- FAIL: TestClientAuthEndEntityKeyTooSmall (0.00s)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what s your security level? cat /etc/ssl/openssl.cnf please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, I think the implementation should be resilient to openssl configuration if possible.

Copy link
Contributor Author

@merlin-northern merlin-northern Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would merge this, and then create a follow up, without this one we will have to fork openssl wrapper. We might do it anyways, but for the sake of continuing, I would beg to try to make it work at level2 and then first thing next free moment do as you say. since I kind of agree :)

transport := http.Transport{
TLSClientConfig: &tlsc,
Proxy: http.ProxyFromEnvironment,
DialTLS: func(network string, addr string) (net.Conn, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs recommend using DialTLSContext:

// DialTLS [...]
// Deprecated: Use DialTLSContext instead, which allows the transport
// to cancel dials as soon as they are no longer needed.
// If both are set, DialTLSContext takes priority.

However, I don't think we use request contexts within the client so I'm not sure if this is relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. Alf, we have to support older go, thats why I use the deprecated method, and also that is why I added the comment about ts.EnableHTTP2 above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second thought I agree as well. Besides, I just discovered that the openssl library has hardcoded net.Dial anyway...

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from a86277f to 3cf5289 Compare August 5, 2020 09:11
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174476956

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern
Copy link
Contributor Author

  • The two first commits (implementation and tests) should be combined together IMO. Specially for change sets that include new golang dependencies, there is a chance that these are not in Debian and we need to revert the change. In that case, a single patch is better than two :)

merged and skipped the .gitignore update.

  • You don't need the JIRA link in the commit message (changelog-generator creates it for you if you have a MEN-XXXX reference). It doesn't hurt, though, so it is just FYI.

removed.

Copy link
Member

@lluiscampos lluiscampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With latest rebase we lost the nice Changelog. Please fix that.

The rest, from my side, looks good to go (after the meta-mender PR, of course)

}))
}),
localhostCert,
localhostKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that, for example, var localhostCertExpired is the same content as file client/server.expired.crt. So for these (variables that are duplicated in files) we could just read the files.

It is not a big deal anyway, leave it as-is if you like it more.

@merlin-northern
Copy link
Contributor Author

With latest rebase we lost the nice Changelog. Please fix that.

ah, right!

The rest, from my side, looks good to go (after the meta-mender PR, of course)

right!

@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #581 into master will increase coverage by 0.58%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #581      +/-   ##
==========================================
+ Coverage   69.90%   70.49%   +0.58%     
==========================================
  Files          57       57              
  Lines        6520     6551      +31     
==========================================
+ Hits         4558     4618      +60     
+ Misses       1494     1466      -28     
+ Partials      468      467       -1     
Impacted Files Coverage Δ
client/client.go 96.25% <100.00%> (+0.74%) ⬆️
client/client_auth.go 55.38% <0.00%> (-27.70%) ⬇️
cli/cli.go 68.85% <0.00%> (+0.69%) ⬆️
installer/dual_rootfs_device.go 72.79% <0.00%> (+1.47%) ⬆️
installer/block_device.go 74.19% <0.00%> (+3.87%) ⬆️
cli/snapshot.go 63.13% <0.00%> (+5.06%) ⬆️
installer/partitions.go 84.61% <0.00%> (+6.83%) ⬆️
system/ioctl.go 72.66% <0.00%> (+12.94%) ⬆️

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from 3cf5289 to a228500 Compare August 5, 2020 13:39
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174588786

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174589994

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern
Copy link
Contributor Author

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from a228500 to 7245bdb Compare August 6, 2020 09:21
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174917657

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from 7245bdb to 9747a9f Compare August 6, 2020 09:25
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174919466

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174965196

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

All server communication goes through openssl:

* custom dial function is provided
* new verification errors are handled

Unit tests fixes:

* new certs
* new call startTestHTTPS, to avoid build-in localhostCert from httptest
* new tests:
  * TestClientAuthDepthZeroSelfSignedCert
    X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
  * TestClientAuthEndEntityKeyTooSmall
    X509_V_ERR_EE_KEY_TOO_SMALL
* test host added to /etc/hosts in .gitlab-ci.yml
* added host verification error test
* added no verify test

ChangeLog:Switch to OpenSSL for all server communication.
Signed-off-by: Peter Grzybowski <peter@northern.tech>
@merlin-northern merlin-northern force-pushed the men_3730_all_server_communication_via_openssl branch from 9747a9f to 63d50ed Compare August 6, 2020 12:47
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-174999555

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BASE_BRANCH master
BUILD_BEAGLEBONEBLACK true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_API_GATEWAY_DOCKER_REV origin/master
MENDER_ARTIFACT_REV origin/master
MENDER_CLI_REV origin/master
MENDER_REV pull/581/head
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

*/
import "C"

var OpenSSLSecurityLevel = C.X_SSL_get_security_level()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is @alfrunes !

@merlin-northern
Copy link
Contributor Author

@merlin-northern merlin-northern merged commit 446090c into mendersoftware:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants