Skip to content

Commit d17455a

Browse files
committed
Configuration to disable TLS
Added configuration to dub.sdl that will disable TLS.
1 parent eeb2f41 commit d17455a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

dub.sdl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ configuration "with_openssl" {
1515
versions "hasOpenssl"
1616
dependency "openssl" version="~>1.1.4+1.0.1g"
1717
lflags "-L/usr/local/opt/openssl/lib"
18+
}
19+
configuration "without_tls" {
20+
platforms "osx" "windows" "linux"
1821
}

source/upromised/loop.d

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ Loop defaultLoop() {
128128
} else version(hasSecurity) {
129129
return Promise!TlsContext.resolved(TlsContext.init);
130130
} else {
131-
auto r = new Promise!TlsContext;
132-
r.reject(new Exception("TLS not supported"));
133-
return r;
131+
return Promise!TlsContext.rejected(new Exception("TLS not supported"));
134132
}
135133
}
136134

@@ -156,9 +154,7 @@ Loop defaultLoop() {
156154
.then!Stream(() => r);
157155
});
158156
} else {
159-
auto r = new Promise!Stream;
160-
r.reject(new Exception("TLS not supported"));
161-
return r;
157+
return Promise!Stream.rejected(new Exception("TLS not supported"));
162158
}
163159
}
164160

0 commit comments

Comments
 (0)