Skip to content

Commit 0b0844c

Browse files
committed
WIP
1 parent cf6e599 commit 0b0844c

File tree

2 files changed

+50
-58
lines changed

2 files changed

+50
-58
lines changed

src/QUICServer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ class QUICServer extends EventTarget {
8484
key: ArrayBuffer;
8585
ops: Crypto;
8686
};
87-
config: Partial<QUICConfig & {
87+
config: Partial<QUICConfig> & {
8888
key: string | Array<string> | Uint8Array | Array<Uint8Array>;
8989
cert: string | Array<string> | Uint8Array | Array<Uint8Array>;
90-
}>;
90+
};
9191
socket?: QUICSocket;
9292
resolveHostname?: (hostname: Hostname) => Host | PromiseLike<Host>;
9393
reasonToCode?: StreamReasonToCode;

tests/QUICServer.test.ts

+48-56
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ describe(QUICServer.name, () => {
9797
const quicServer = new QUICServer({
9898
crypto,
9999
config: {
100-
tlsConfig: {
101-
privKeyPem: keyPairRSAPEM.privateKey,
102-
certChainPem: certRSAPEM,
103-
},
100+
key: keyPairRSAPEM.privateKey,
101+
cert: certRSAPEM,
104102
},
105103
logger: logger.getChild('QUICServer'),
106104
});
@@ -114,10 +112,8 @@ describe(QUICServer.name, () => {
114112
const quicServer = new QUICServer({
115113
crypto,
116114
config: {
117-
tlsConfig: {
118-
privKeyPem: keyPairECDSAPEM.privateKey,
119-
certChainPem: certECDSAPEM,
120-
},
115+
key: keyPairECDSAPEM.privateKey,
116+
cert: certECDSAPEM,
121117
},
122118
logger: logger.getChild('QUICServer'),
123119
});
@@ -131,10 +127,8 @@ describe(QUICServer.name, () => {
131127
const quicServer = new QUICServer({
132128
crypto,
133129
config: {
134-
tlsConfig: {
135-
privKeyPem: keyPairEd25519PEM.privateKey,
136-
certChainPem: certEd25519PEM,
137-
},
130+
key: keyPairEd25519PEM.privateKey,
131+
cert: certEd25519PEM,
138132
},
139133
logger: logger.getChild('QUICServer'),
140134
});
@@ -145,59 +139,57 @@ describe(QUICServer.name, () => {
145139
await quicServer.stop();
146140
});
147141
});
148-
test('bootstrapping a new connection', async () => {
149-
const quicServer = new QUICServer({
150-
crypto,
151-
config: {
152-
tlsConfig: {
153-
privKeyPem: keyPairEd25519PEM.privateKey,
154-
certChainPem: certEd25519PEM,
155-
},
156-
},
157-
logger: logger.getChild('QUICServer'),
158-
});
159-
await quicServer.start();
142+
// test('bootstrapping a new connection', async () => {
143+
// const quicServer = new QUICServer({
144+
// crypto,
145+
// config: {
146+
// key: keyPairEd25519PEM.privateKey,
147+
// cert: certEd25519PEM,
148+
// },
149+
// logger: logger.getChild('QUICServer'),
150+
// });
151+
// await quicServer.start();
160152

161-
const scidBuffer = new ArrayBuffer(quiche.MAX_CONN_ID_LEN);
162-
await crypto.ops.randomBytes(scidBuffer);
163-
const scid = new QUICConnectionId(scidBuffer);
153+
// const scidBuffer = new ArrayBuffer(quiche.MAX_CONN_ID_LEN);
154+
// await crypto.ops.randomBytes(scidBuffer);
155+
// const scid = new QUICConnectionId(scidBuffer);
164156

165-
const socket = new QUICSocket({
166-
crypto,
167-
resolveHostname: utils.resolveHostname,
168-
logger: logger.getChild(QUICSocket.name),
169-
});
170-
await socket.start();
157+
// const socket = new QUICSocket({
158+
// crypto,
159+
// resolveHostname: utils.resolveHostname,
160+
// logger: logger.getChild(QUICSocket.name),
161+
// });
162+
// await socket.start();
171163

172-
// Const config = buildQuicheConfig({
173-
// ...clientDefault
174-
// });
175-
// Here we want to VERIFY the peer
176-
// If we use the same certificate
177-
// then it should be consider as if it is trusted!
164+
// // Const config = buildQuicheConfig({
165+
// // ...clientDefault
166+
// // });
167+
// // Here we want to VERIFY the peer
168+
// // If we use the same certificate
169+
// // then it should be consider as if it is trusted!
178170

179-
const quicConfig: QUICConfig = {
180-
...clientDefault,
181-
verifyPeer: true,
182-
};
171+
// const quicConfig: QUICConfig = {
172+
// ...clientDefault,
173+
// verifyPeer: true,
174+
// };
183175

184-
const connection = await QUICConnection.connectQUICConnection({
185-
scid,
186-
socket,
176+
// const connection = await QUICConnection.connectQUICConnection({
177+
// scid,
178+
// socket,
187179

188-
remoteInfo: {
189-
host: utils.resolvesZeroIP(quicServer.host),
190-
port: quicServer.port,
191-
},
180+
// remoteInfo: {
181+
// host: utils.resolvesZeroIP(quicServer.host),
182+
// port: quicServer.port,
183+
// },
192184

193-
config: quicConfig,
194-
});
185+
// config: quicConfig,
186+
// });
195187

196-
await socket.stop();
197-
await quicServer.stop();
188+
// await socket.stop();
189+
// await quicServer.stop();
198190

199-
// We can run with several rsa keypairs and certificates
200-
});
191+
// // We can run with several rsa keypairs and certificates
192+
// });
201193
describe('updating configuration', () => {
202194
// We want to test changing the configuration over time
203195
});

0 commit comments

Comments
 (0)