Comments (5)
from cos-go-sdk-v5.
可能和 docker 有关系,我用的 debian 镜像。 等我去做个demo 。
from cos-go-sdk-v5.
@tomleader
我用你这个demo,做了个镜像。
https://github.com/hyacinthus/cos-go-sdk-v5/blob/master/example/object/Dockerfile
代码和镜像都在这里
下边是运行时的截图
➜ xbswarm git:(master) ✗ sh test.sh
Unable to find image 'hub.tencentyun.com/muninn/costest:latest' locally
latest: Pulling from muninn/costest
54f7e8ac135a: Already exists
06be90607741: Pull complete
Digest: sha256:07ff03fd79892259f3d65597bf0107dc840e2d98bd8dba3b2111d3acdf12ab4e
Status: Downloaded newer image for hub.tencentyun.com/muninn/costest:latest
GET /test.txt HTTP/1.1
Host: static-xxx.cos.ap-shanghai.myqcloud.com
User-Agent: cos-go-sdk-v5/0.7.3
Authorization: q-sign-algorithm=sha1&q-ak=xxx&q-sign-time=1545062023;1545065623&q-key-time=1545062023;1545065623&q-header-list=content-type&q-url-param-list=&q-signature=xxx
Content-Type: application/xml
Accept-Encoding: gzip
panic: Get https://static-xxx.cos.ap-shanghai.myqcloud.com/test.txt: x509: certificate signed by unknown authority
goroutine 1 [running]:
main.main()
/app/get.go:36 +0x7c8
大家用golang一般都是在docker里的,我在服务器上还真没装golang环境,也没法直接试验。
from cos-go-sdk-v5.
嗯,那可以先排除下是否是docker环境的因素,在内网装个go的amd包跑程序试下,明天我也试下docker环境的
from cos-go-sdk-v5.
不好意思,经过这么一对比,刚又琢磨了一会,想起来我遇到过的这个坑。
虽然走的内网但是cvm是能连外网的,应该是能验证签名的呀。
于是想起来 debian 的裸镜像是没预装证书的。
需要在 dockerfile 里自己装 ca-certificates 这个包。
...
FROM debian
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
ENV TZ=Asia/Shanghai
COPY --from=build-env /app/app /usr/bin/app
CMD ["app"]
ps. 一不小心忘记隐藏ak了,只能重新生成一个。。。
from cos-go-sdk-v5.
Related Issues (20)
- Support `POST` method for object presign HOT 1
- 为什么 v0.7.12 的 presignURL 会有 u0026 转义问题? HOT 2
- 上传为什么不支持 io.Reader, 常用的都是上传业务, 这样还得先存到临时目录再用 HOT 1
- Is wrong tag? HOT 1
- The path in the *url.URL returned by GetPresignedURL begins with 2 "/" when param name begin with "/" HOT 1
- Copy 接口返回「expected element type <CopyObjectResult> but have <Error>」 HOT 1
- 我能在 newclient 之后再设置 bucketurl么 看了下api 没找到合适的 或者说有没有灵活点的,不然每次不同的bucket都需要从新new一次 HOT 1
- 不支持form-data请求方式上传到cos
- rand.Seed 只需要在init中设置一次 HOT 1
- `tencentcloud/tencentcloud-sdk-go` 的版本冲突问题 HOT 3
- why not Add x-cos-tagging header when create bucket HOT 1
- 上传文件时如何添加自定义header? HOT 3
- 证书换了吗 HOT 2
- 没有CORS Vary: Origin相关的api HOT 1
- 如何使用内部ip
- 上传本地文件夹问题 HOT 2
- 高级分块上传支持自定义分块上传worker HOT 1
- Object.GetPresignedURL能否支持自定义authtime startTime HOT 1
- GetObjectURL无法获取到正确的链接。
- 您好,ACL用到的一些的字面值常量是否可以做成枚举值呢?或者加一些内置的常量这样外部调用时可以引用? 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 cos-go-sdk-v5.