Skip to content

Commit

Permalink
replace common name of cert with target host
Browse files Browse the repository at this point in the history
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
  • Loading branch information
spameier committed Dec 21, 2022
1 parent 52a8fe4 commit bfb29fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyrdp/mitm/RDPMITM.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ def doClientTls(self):
# Wait for server certificate
reactor.callLater(1, self.doClientTls)

if cert.get_subject().commonName != self.config.targetHost:
cert.get_subject().commonName = self.config.targetHost

# Clone certificate if necessary.
if self.certs:
privKey, certFile = self.certs.lookup(cert)
Expand Down

0 comments on commit bfb29fe

Please sign in to comment.