Skip to content

Commit 9edd254

Browse files
committed
replace common name of cert with target host
This reduces the error message an mstsc client sees from two to one. before: - The server name on the certificate is incorrect - The certificate is not from a trusted certifying authority after: - The certificate is not from a trusted certifying authority
1 parent 46e0131 commit 9edd254

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyrdp/mitm/RDPMITM.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def doClientTls(self):
238238
# Wait for server certificate
239239
reactor.callLater(1, self.doClientTls)
240240

241+
if cert.get_subject().commonName != self.config.targetHost:
242+
cert.get_subject().commonName = self.config.targetHost
243+
241244
# Clone certificate if necessary.
242245
if self.certs:
243246
privKey, certFile = self.certs.lookup(cert)

0 commit comments

Comments
 (0)