Comments (6)
UPDATE: Neither MarkAsScalar
or SetCustomFunc
works on pointer types. I cannot use current mechanism to fix this issue. I need to add a new API MarkAsOpaquePointer
to fix this issue.
from go-clone.
Can you please provide a demo to reproduce this issue? It can help me to understand this issue much better. Thanks.
from go-clone.
func deepCopyCert(cert *tls.Certificate) *tls.Certificate {
return clone.Clone(cert).(*tls.Certificate)
}
Deep copy the certificate(ECC type) and return the new one like the code above. When using the returning certificate, it will fail to handshake with error:
tls: unsupported certificate curve (P-256)
Search the error tls: unsupported certificate curve
in golang source code, locate to:
from go-clone.
The root cause is that package crypto/tls
validates the curve of a certificate public key by pointer rather than by value. I can mark elliptic.CurveParams
as scalar to solve this problem.
from go-clone.
Tag v1.3.0 is pushed to fix this issue.
from go-clone.
Thanks!
from go-clone.
Related Issues (17)
- can not copy *zap.Logger HOT 1
- Suggestion: use the type's own Clone method HOT 7
- String 是否始终不应作为标量进行 Clone HOT 3
- 调研:使用 go-clone 的业务场景 HOT 5
- Help Wanted: Survey of use cases using this package HOT 3
- How to process nested pointer for arena.New HOT 3
- Question: no clone HOT 3
- Cloning struct with unexported pointer fails HOT 1
- "go vet" fails in Go 1.18 HOT 1
- CustomFunc should allow Ptr types as well HOT 10
- List clone incorrect HOT 4
- the same question :orderedmap used List HOT 2
- Ignore serialization HOT 1
- Build failed on Linux MIPS 32bit HOT 6
- 偶发panic: fatal error: found pointer to free object HOT 9
- go1.16无法构建? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-clone.