You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
secretflow代码如下:
`
import secretflow as sf
import os
import sys
import time
import logging
import multiprocess
from absl import app
import spu
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
我在采用tls验证之后,两方连接不成功,一直报not match found for servername:xxx 看到之前的issue里有相同的错误说是生成tls证书的时候没有加ip,但是我在生成的时候填写了cn部分,报错如下:
tls生成脚本和相关secretflow代码如下:
`#!/bin/bash
openssl genrsa -out alice_ca.key 2048
openssl req -new -key alice_ca.key -out alice_ca.csr -subj "/C=CN/ST=myprovince/L=mycity/O=myorganization/OU=mygroup/CN=myCA"
openssl x509 -req -days 365 -in alice_ca.csr -signkey alice_ca.key -out alice_ca.crt
openssl genrsa -out alice_server_key.key 2048
openssl req -new -sha256 -key alice_server_key.key -out alice_server_key.csr -subj "/CN=192.168.56.155"
openssl x509 -req -in alice_server_key.csr -CA alice_ca.crt -CAkey alice_ca.key -CAcreateserial -days 7120 -out alice_server_cert.crt
openssl verify -CAfile alice_ca.crt alice_server_cert.crt`
secretflow代码如下:
`
import secretflow as sf
import os
import sys
import time
import logging
import multiprocess
from absl import app
import spu
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
start=time.time()
tls_config = {
"ca_cert": "/home/fate01/secretflow-code/certificate/cert/alice_ca.crt",
"cert": "/home/fate01/secretflow-code/certificate/cert/bob_server_cert.crt",
"key": "/home/fate01/secretflow-code/certificate/cert/bob_server_key.key",
}
cluster_config ={
'parties': {
'alice': {
'address': '192.168.56.155:9923',
'listen_addr': '0.0.0.0:9923'
},
'bob': {
}
sf.init(address='192.168.56.156:25174', cluster_config=cluster_config,tls_config=tls_config)
alice = sf.PYU('alice')
bob = sf.PYU('bob')
cluster_def={
'nodes': [
{
'party': 'alice',
'id':'alice',
'address': '192.168.56.155:25676',
'listen_addr': '0.0.0.0:25676'
},
{
'party': 'bob',
'id':'bob',
'address': '192.168.56.156:25176',
'listen_addr': '0.0.0.0:25176'
},
],
'runtime_config': {
'protocol': spu.spu_pb2.CHEETAH,
'field': spu.spu_pb2.FM32,
'sigmoid_mode': spu.spu_pb2.RuntimeConfig.SIGMOID_REAL,
}
}
link_desc = {
'recv_timeout_ms': 36000,
}
spu = sf.SPU(cluster_def=cluster_def,link_desc=link_desc)
input_path = {alice: 'database/psi1.csv', bob: '/home/fate01/secretflow-code/database/psi2.csv'}
output_path = {alice: '.data/1_psi.csv', bob: '.data/2_psi.csv'}
spu.psi_csv('id', input_path, output_path, 'alice',protocol='ECDH_PSI_2PC',curve_type="CURVE_FOURQ",bucket_size=1<<30)
logging.info(f"cost time: {time.time() - start}")
`
Beta Was this translation helpful? Give feedback.
All reactions