GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value · Issue #1610 · binarywang/WxJava

Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value #1610

New issue
Copy link
New issue
Copy link
Closed
Closed
Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value#1610
Copy link

Description

@icodingx
icodingx
opened on Jun 9, 2020
Issue body actions

简要描述

public String authGet(@PathVariable Long appId,
@RequestParam(name = "msg_signature", required = false) String signature,
@RequestParam(name = "timestamp", required = false) String timestamp,
@RequestParam(name = "nonce", required = false) String nonce,
@RequestParam(name = "echostr", required = false) String echostr) {
//...
if (wxCpService.checkSignature(signature, timestamp, nonce, echostr)) {
// 这里调 decrypt(echostr) 发生异常,应该是依赖的版本有冲突
return new WxCpCryptUtil(wxCpService.getWxCpConfigStorage()).decrypt(echostr);
}
return "非法请求";
image

模块版本情况

  • WxJava 模块名: weixin-java-cp
  • WxJava 版本号: 3.8.0

详细描述

尽量详细描述。请不要使用截图,尽量使用文字描述,代码直接贴上来,日志则请附在后面所示区域。

日志

java.lang.IllegalArgumentException: Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value
at org.apache.commons.codec.binary.Base64.validateCharacter(Base64.java:798)
at org.apache.commons.codec.binary.Base64.decode(Base64.java:477)
at org.apache.commons.codec.binary.BaseNCodec.decode(BaseNCodec.java:411)
at org.apache.commons.codec.binary.BaseNCodec.decode(BaseNCodec.java:395)
at org.apache.commons.codec.binary.Base64.decodeBase64(Base64.java:694)
at me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil.(WxCpCryptUtil.java:47)

Activity

  1. 13756289007 commented on Jun 11, 2020

    @13756289007
    13756289007
    on Jun 11, 2020
    More actions

    楼主解决了吗? 我也遇到这个问题了 一开始以为是JDK的问题 但是换了好多个版本都是一样的问题

  2. binarywang commented on Jun 11, 2020

    @binarywang
    binarywang
    on Jun 11, 2020
    Owner
    More actions

    #1454 猜测跟这个有关系

  3. binarywang commented on Jun 11, 2020

    @binarywang
    binarywang
    on Jun 11, 2020
    Owner
    More actions

    请检查 commons-codec 版本,不能用 1.13的

  4. binarywang
    changed the title [-]weixin-java-cp[/-] [+]Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value[/+] on Jun 11, 2020
  5. binarywang commented on Jun 11, 2020

    @binarywang
    binarywang
    on Jun 11, 2020
    Owner
    More actions

    wiki里常见问题里有说明过这个问题

  6. binarywang
    closed this as completedon Jun 11, 2020
  7. binarywang commented on Jun 11, 2020

    @binarywang
    binarywang
    on Jun 11, 2020
    Owner
    More actions

    准备换用guava替代commons-codec实现base64解码

  8. binarywang
    added a commit that references this issue on Jun 11, 2020

    🎨 #1610 换用guava的相应方法实现base64解码,避免因commons-codec版本问题导致解码异常

    29b4dbd
  9. refeccd commented on Nov 21, 2020

    @refeccd
    refeccd
    on Nov 21, 2020
    More actions

    这个替换也没替换完啊,3.9.0里WxCryptUtil、WxMaCryptUtils、WxPayRefundNotifyResult、EntPayServiceImpl、还是用的 commons-codec

  10. binarywang commented on Nov 21, 2020

    @binarywang
    binarywang
    on Nov 21, 2020
    Owner
    More actions

    这个替换也没替换完啊,3.9.0里WxCryptUtil、WxMaCryptUtils、WxPayRefundNotifyResult、EntPayServiceImpl、还是用的 commons-codec

    谁说要完全替换的,只是关于base64编码的代码

  11. Repository owner locked as resolved and limited conversation to collaborators on Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.