On OpenSSL 3, engines have been deprecated being replaced by providers. The Ruby openssl library supported loading specific engines, but there is no replacement currently using providers. The winrm communicator specifically relies on a MD4 which OpenSSL has marked as legacy and no longer loads by default. The extension included loads the legacy provider as well as the default provider. The legacy provider includes MD4, thus allowing winrm to function again.
33 lines
710 B
C
33 lines
710 B
C
#include "vagrant_ssl.h"
|
|
|
|
#if defined(_VAGRANT_SSL_PROVIDER_)
|
|
|
|
static VALUE vagrant_ssl_load(VALUE self) {
|
|
OSSL_PROVIDER *legacy;
|
|
OSSL_PROVIDER *deflt;
|
|
|
|
legacy = OSSL_PROVIDER_load(NULL, "legacy");
|
|
if(legacy == NULL) {
|
|
rb_raise(rb_eStandardError, "Failed to load OpenSSL legacy provider");
|
|
return self;
|
|
}
|
|
|
|
deflt = OSSL_PROVIDER_load(NULL, "default");
|
|
if(deflt == NULL) {
|
|
rb_raise(rb_eStandardError, "Failed to load OpenSSL default provider");
|
|
return self;
|
|
}
|
|
}
|
|
|
|
void Init_vagrant_ssl(void) {
|
|
VALUE vagrant;
|
|
vagrant = rb_define_module("Vagrant");
|
|
rb_define_singleton_method(vagrant, "vagrant_ssl_load", vagrant_ssl_load, 0);
|
|
}
|
|
|
|
#else
|
|
|
|
void Init_vagrant_ssl(void) {}
|
|
|
|
#endif
|