Skip to content

Commit

Permalink
Move away from dep datetime call (#79)
Browse files Browse the repository at this point in the history
Python 3.12 deprecated datetime.datetime.utcnow() in favour of
datetime.datetime.now(datetime.timezone.utc) to ensure that a non naive
dt object was created. This PR moved to the newer syntax where the older
one was used.
  • Loading branch information
jborean93 authored Mar 10, 2024
1 parent a630aa6 commit 03824ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"python.testing.pytestEnabled": true,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Support input password string encoded with the `surrogatepass` error option
* This allows the caller to provide a password for a gMSA or machine account that could contain invalid surrogate pairs for both NTLM and Kerberos auth.
* Stop using deprecated `datetime.dateime.utcnow()` for CredSSP acceptor context

## 0.10.2 - 2023-10-04

Expand Down
2 changes: 1 addition & 1 deletion src/spnego/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def generate_tls_certificate() -> typing.Tuple[bytes, bytes, bytes]:
# socket.getfqdn() can block for a few seconds if DNS is not set up properly.
name = x509.Name([x509.NameAttribute(x509.NameOID.COMMON_NAME, "CREDSSP-%s" % platform.node())])

now = datetime.datetime.utcnow()
now = datetime.datetime.now(datetime.timezone.utc)
cert = (
x509.CertificateBuilder()
.subject_name(name)
Expand Down

0 comments on commit 03824ee

Please sign in to comment.