Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .ci/generate_certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

set -e

# Create certs directory
mkdir -p certs
pushd certs > /dev/null

# Generate private key for CA
openssl genrsa -out ca.key 4096

# Generate self-signed CA certificate
openssl req -x509 -new -nodes -key ca.key -sha256 -days 200 -out ca.crt \
-subj "/CN=MyRootCA"

# Generate server private key
openssl genrsa -out server.key 4096

# Generate a certificate signing request (CSR) for the server
openssl req -new -key server.key -out server.csr \
-subj "/CN=localhost"

# Generate server certificate signed by the CA
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
-out server.crt -days 3650 -sha256 -extfile ../.ci/server_ext.cnf -extensions v3_req

# Generate client private key
openssl genrsa -out client.key 4096

# Generate a certificate signing request (CSR) for the client
openssl req -new -key client.key -out client.csr \
-subj "/CN=grpc-client"

# Generate client certificate signed by the CA
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
-out client.crt -days 200 -sha256

# Verify server certificate
openssl verify -CAfile ca.crt server.crt

# Verify client certificate
openssl verify -CAfile ca.crt client.crt

popd > /dev/null
10 changes: 10 additions & 0 deletions .ci/server_ext.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[ v3_req ]
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[ alt_names ]
DNS.1 = localhost
IP.1 = 127.0.0.1
IP.2 = ::1

6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ install:
install-test:
@pip install -r requirements/requirements_build.txt
@pip install ansys-fluent-core[reader,tests]
@pip install cryptography==45.0.7
@python -m pip install -q --force-reinstall dist/*.whl > /dev/null
@python tests/generate_certs.py
@bash .ci/generate_certs.sh

version-info:
@bash -c "date -u +'Build date: %B %d, %Y %H:%M UTC ShaID: <id>' | xargs -I date sed -i 's/_VERSION_INFO = .*/_VERSION_INFO = \"date\"/g' src/ansys/fluent/core/__init__.py"
Expand Down Expand Up @@ -175,8 +174,7 @@ api-codegen:
@python -m venv env
@. env/bin/activate
@pip install -q -e .
@pip install cryptography==45.0.7
@python tests/generate_certs.py
@bash .ci/generate_certs.sh
@python codegen/allapigen.py
@rm -rf env

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/4691.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the certificate generation steps from the dev guide
3 changes: 3 additions & 0 deletions src/ansys/fluent/core/docker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def _is_grpc_patched(image_tag: str):
if image_tag.startswith("sha256:"):
return True

if image_tag == "v26.1.latest":
return True

min_patched_versions = {
"v25.2": 3,
"v25.1": 4,
Expand Down
Loading